| | |
| | | :xAxis="salesAmountXAxis" |
| | | :yAxis="salesAmountYAxis" |
| | | :series="salesAmountSeries" |
| | | style="height: 300px" /> |
| | | style="height: 90%" /> |
| | | </section> |
| | | </div> |
| | | <div class="right-col"> |
| | |
| | | <el-radio-group v-model="chartRangePlan" |
| | | size="small" |
| | | @change="loadPlanTrend"> |
| | | <el-radio-button :label="1">日</el-radio-button> |
| | | <el-radio-button :label="2">周</el-radio-button> |
| | | <el-radio-button :label="3">月</el-radio-button> |
| | | <el-radio-button :label="1">周</el-radio-button> |
| | | <el-radio-button :label="2">月</el-radio-button> |
| | | <el-radio-button :label="3">年</el-radio-button> |
| | | </el-radio-group> |
| | | </div> |
| | | <Echarts :chartStyle="chartStyle" |
| | |
| | | <section class="section-card mini-table-wrap" |
| | | v-if="isSectionVisible('planTable')"> |
| | | <div class="section-title">最近报工</div> |
| | | <el-table :data="planTable" |
| | | <el-table :data="reportingTable" |
| | | size="small" |
| | | stripe> |
| | | <el-table-column prop="planNo" |
| | | label="班次" |
| | | stripe |
| | | :loading="reportingTableLoading"> |
| | | <el-table-column prop="productNo" |
| | | label="报工编号" |
| | | min-width="150" /> |
| | | <el-table-column prop="product" |
| | | <el-table-column prop="schedule" |
| | | label="班组" |
| | | min-width="80"> |
| | | <template #default="{ row }"> |
| | | <el-tag :type="row.schedule === '白班' ? 'primary' : 'warning'">{{ row.schedule || '-' }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="postName" |
| | | label="创建人" |
| | | min-width="120" /> |
| | | <el-table-column prop="product" |
| | | min-width="100" /> |
| | | <el-table-column prop="createTime" |
| | | label="报工时间" |
| | | min-width="120" /> |
| | | <el-table-column prop="qty" |
| | | min-width="150"> |
| | | <template #default="{ row }"> |
| | | {{ row.createTime ? dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') : '' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="productName" |
| | | label="产品" |
| | | min-width="90" /> |
| | | <el-table-column prop="issued" |
| | | min-width="120"> |
| | | <template #default="{ row }"> |
| | | <el-tag :type="row.productName === '砌块' ? 'primary' : 'warning'">{{ row.productName || '-' }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="totalQuantity" |
| | | label="生产数量" |
| | | min-width="90" /> |
| | | <el-table-column prop="issued" |
| | | min-width="100"> |
| | | <template #default="{ row }"> |
| | | <span style="color:rgba(18, 148, 212, 0.8);">{{ row.totalQuantity || '-' }}</span> 方 |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="quantity" |
| | | label="合格数量" |
| | | min-width="90" /> |
| | | min-width="100"> |
| | | <template #default="{ row }"> |
| | | <span style="color:rgba(0, 228, 99, 0.8);">{{ row.quantity || '-' }}</span> 方 |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </section> |
| | | </div> |
| | |
| | | processDataProductionStatistics, |
| | | qualityInspectionStatistics, |
| | | nonComplianceWarning, |
| | | getManageStatistics, |
| | | planTrends, |
| | | } from "@/api/viewIndex.js"; |
| | | import { energyConsumptionDetailStatistics } from "@/api/energyManagement/energyType"; |
| | | import { getSalesAmountAnalysis } from "@/api/reportAnalysis/salesStatistics"; |
| | | import { productionReportListPage } from "@/api/productionManagement/productionReporting.js"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | const router = useRouter(); |
| | | const userStore = useUserStore(); |
| | |
| | | { name: "已完成订单数", value: "-" }, |
| | | { name: "未完成订单数", value: "-" }, |
| | | { name: "部分完成订单数", value: "-" }, |
| | | { name: "质检总数", value: "-" }, |
| | | { name: "过程检总数", value: "-" }, |
| | | { name: "来料检总数", value: "-" }, |
| | | // { name: "过程检总数", value: "-" }, |
| | | ]); |
| | | |
| | | const pendingTasks = reactive([]); |
| | |
| | | }); |
| | | }; |
| | | |
| | | const planTable = reactive([]); |
| | | // 报工表格数据 |
| | | const reportingTable = ref([]); |
| | | const reportingTableLoading = ref(false); |
| | | |
| | | // 获取最近报工数据 |
| | | const fetchReportingData = () => { |
| | | reportingTableLoading.value = true; |
| | | productionReportListPage({ |
| | | current: 1, |
| | | size: 5, // 只显示最近5条 |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | console.log(res.data.records || []); |
| | | reportingTable.value = res.data.records || []; |
| | | } else { |
| | | reportingTable.value = []; |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.error("获取报工数据失败:", error); |
| | | reportingTable.value = []; |
| | | }) |
| | | .finally(() => { |
| | | reportingTableLoading.value = false; |
| | | }); |
| | | }; |
| | | const recentTrendCards = reactive([ |
| | | { |
| | | key: "planIssued", |
| | |
| | | }; |
| | | |
| | | const loadPlanTrend = async () => { |
| | | // try { |
| | | // const res = await processDataProductionStatistics({ |
| | | // type: chartRangePlan.value, |
| | | // }); |
| | | // const list = Array.isArray(res?.data) ? res.data : []; |
| | | // planXAxis[0].data = list.map( |
| | | // (i, index) => i.processName || `工序${index + 1}` |
| | | // ); |
| | | // planSeries[0].data = list.map(i => |
| | | // pickFirstNumber(i, ["totalInput", "input", "planNum"]) |
| | | // ); |
| | | // planSeries[1].data = list.map(i => |
| | | // pickFirstNumber(i, ["totalOutput", "output", "issueNum"]) |
| | | // ); |
| | | // planSeries[2].data = list.map(i => |
| | | // pickFirstNumber(i, ["totalScrap", "scrap", "completeNum"]) |
| | | // ); |
| | | // } catch (error) { |
| | | // console.error("processDataProductionStatistics接口获取失败:", error); |
| | | // } |
| | | try { |
| | | const res = await planTrends({ |
| | | type: chartRangePlan.value, |
| | | }); |
| | | const list = Array.isArray(res?.data) ? res.data : []; |
| | | planXAxis[0].data = list.map(i => i.dateStr || "-"); |
| | | planSeries[0].data = list.map(i => i.plannedVolume || 0); |
| | | planSeries[1].data = list.map(i => i.lowerVolume || 0); |
| | | planSeries[2].data = list.map(i => i.completionVolume || 0); |
| | | } catch (error) { |
| | | console.error("planTrends接口获取失败:", error); |
| | | } |
| | | }; |
| | | |
| | | const loadQualityData = async () => { |
| | |
| | | // console.error("expenseCompositionAnalysis接口获取失败:", error); |
| | | // } |
| | | }; |
| | | const loadManageStatistics = async () => { |
| | | try { |
| | | const res = await getManageStatistics(); |
| | | const data = res?.data || {}; |
| | | businessFocus[0].value = `${pickFirstNumber(data, ["total"])} 条`; |
| | | businessFocus[1].value = `${pickFirstNumber(data, ["completed"])} 条`; |
| | | businessFocus[2].value = `${pickFirstNumber(data, ["uncompleted"])} 条`; |
| | | businessFocus[3].value = `${pickFirstNumber(data, [ |
| | | "partialCompleted", |
| | | ])} 条`; |
| | | businessFocus[4].value = `${pickFirstNumber(data, [ |
| | | "materialInspection", |
| | | ])} 条`; |
| | | // businessFocus[5].value = `${pickFirstNumber(data, [""])} 条`; |
| | | } catch (error) { |
| | | console.error("manageStatistics接口获取失败:", error); |
| | | } |
| | | }; |
| | | |
| | | const refreshDashboardData = () => { |
| | | // loadHomeTodos(); |
| | | // loadOrderAndProgress(); |
| | | // loadPlanTrend(); |
| | | loadOrderAndProgress(); |
| | | loadPlanTrend(); |
| | | // loadQualityData(); |
| | | // loadCostComposition(); |
| | | // loadWarningCenter(); |
| | | loadManageStatistics(); |
| | | updateEnergyTypeChart(); |
| | | fetchSalesAmountChartData(); |
| | | fetchReportingData(); |
| | | lastUpdatedAt.value = new Date().toLocaleString(); |
| | | }; |
| | | |