| | |
| | | :xAxis="salesAmountXAxis" |
| | | :yAxis="salesAmountYAxis" |
| | | :series="salesAmountSeries" |
| | | style="height: 300px" /> |
| | | style="height: 90%" /> |
| | | </section> |
| | | </div> |
| | | <div class="right-col"> |
| | |
| | | <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, |
| | | } 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", |
| | |
| | | // 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(); |
| | |
| | | // loadQualityData(); |
| | | // loadCostComposition(); |
| | | // loadWarningCenter(); |
| | | loadManageStatistics(); |
| | | updateEnergyTypeChart(); |
| | | fetchSalesAmountChartData(); |
| | | fetchReportingData(); |
| | | lastUpdatedAt.value = new Date().toLocaleString(); |
| | | }; |
| | | |