浏览代码

feature/统计页面相关

dy 1 年之前
父节点
当前提交
8155cfb80e

+ 18 - 0
src/api/report/index.ts

@@ -0,0 +1,18 @@
+import request from "@/utils/request";
+//每日完工入库Echart图表
+export function getEchartData(data: string) {
+  return request({
+    url: "/api/v1/process/census/completeOrder/list",
+    method: "post",
+    data,
+  });
+}
+//节拍时间段内数据获取
+export function getBeatInfo(data: string) {
+  return request({
+    url: "/api/v1/process/census/beatInfo/page",
+    method: "post",
+    data,
+  });
+}
+

+ 27 - 39
src/views/plan/schedule/index.vue

@@ -1,30 +1,12 @@
 <template>
   <div class="mainContentBox">
-    <avue-crud
-      ref="crudRef"
-      v-model:search="search"
-      v-model="form"
-      :data="data"
-      :option="option"
-      v-model:page="page"
-      @row-save="createRow"
-      @row-update="updateRow"
-      @row-del="deleteRow"
-      @search-change="searchChange"
-      @search-reset="resetChange"
-      @size-change="dataList"
-      @current-change="dataList"
-      @selection-change="selectionChange"
-    >
-
-      <template #menu="{size,row,index}">
-        <el-button
-            icon="el-icon-edit"
-            text
-            v-if="row.state === '-1' || row.state ==='0'"
-            @click="handleEdit(row,index)"
-            type="primary"
-            :size="size">编辑</el-button>
+    <avue-crud ref="crudRef" v-model:search="search" v-model="form" :data="data" :option="option" v-model:page="page"
+      @row-save="createRow" @row-update="updateRow" @row-del="deleteRow" @search-change="searchChange"
+      @search-reset="resetChange" @size-change="dataList" @current-change="dataList"
+      @selection-change="selectionChange">
+      <template #menu="{ size, row, index }">
+        <el-button icon="el-icon-edit" text v-if="row.state === '-1' || row.state === '0'"
+          @click="handleEdit(row, index)" type="primary" :size="size">编辑</el-button>
       </template>
       <template #menu-left>
         <div id="charts"></div>
@@ -36,7 +18,7 @@
 import { ref } from "vue";
 import { useCrud } from "@/hooks/userCrud";
 import dictDataUtil from "@/common/configs/dictDataUtil";
-import {queryStationByLineId} from "@/api/station"
+import { queryStationByLineId } from "@/api/station";
 import { useDictionaryStoreHook } from "@/store";
 import { getStatistics } from "@/api/order/index";
 import * as echarts from "echarts";
@@ -55,14 +37,14 @@ const { selectionChange, multipleDelete } = Methords; //选中和批量删除事
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
 
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
-const stationList = ref([])
-const charts = ref(null);
-const handleEdit =(row,index) =>{
-  queryStationByLineId(row.productLineId).then((data)=>{
-    stationList.value = data.data
-  })
+const stationList = ref([]);
+const charts = shallowRef(null);
+const handleEdit = (row, index) => {
+  queryStationByLineId(row.productLineId).then((data) => {
+    stationList.value = data.data;
+  });
   crudRef.value && crudRef.value.rowEdit(row, index);
-}
+};
 onMounted(() => {
   charts.value = echarts.init(document.getElementById("charts"));
 
@@ -76,6 +58,9 @@ onMounted(() => {
         text: "任务状态统计图",
         left: "center",
       },
+      tooltip: {
+        trigger: "item",
+      },
       xAxis: {
         data: key,
       },
@@ -128,15 +113,17 @@ option.value = Object.assign(option.value, {
       label: "工位名称",
       hide: true,
       editDisabled: false,
-      type: 'select',
+      type: "select",
       dicData: stationList,
       prop: "stationId",
       props: { label: "name", value: "id" },
-      rules: [{
-        required: true,
-        message: "请选择工位名称",
-        trigger: "blur"
-      }],
+      rules: [
+        {
+          required: true,
+          message: "请选择工位名称",
+          trigger: "blur",
+        },
+      ],
     },
     {
       label: "工单编码",
@@ -216,6 +203,7 @@ option.value = Object.assign(option.value, {
 :deep(.avue-crud__left) {
   width: 100%;
 }
+
 #charts {
   width: 100%;
   height: 300px;

+ 395 - 3
src/views/report/statistics/dailystorage/index.vue

@@ -1,7 +1,399 @@
 <template>
-  <div>src/views/report/statistics/dailystorage /index</div>
+  <div class="mainContentBox">
+    <avue-crud ref="crudRef1" v-model:search="data1.search" :data="data1.data" :option="data1.option"
+      v-model:page="data1.page" @row-save="createRow" @row-update="updateRow" @row-del="deleteRow"
+      @search-change="searchChange" @search-reset="resetChange" @size-change="dataList" @current-change="dataList"
+      @selection-change="selectionChange" @cell-click="ckickCell">
+      <template #header="{ size }">
+        <div :key="chartKey" id="dailystoragecharts"></div>
+      </template>
+    </avue-crud>
+    <el-dialog v-model="editDialog.visible" :title="editDialog.title" width="1200px"
+      @close="editDialog.visible = false">
+      <div class="mainContentBox">
+        <avue-crud ref="crudRef2" v-model:search="data2.search" :data="data2.data" :option="data2.option"
+          v-model:page="data2.page" @row-update="data2.Methords.updateRow" @row-del="data2.Methords.deleteRow"
+          @search-change="data2.Methords.dataList" @search-reset="data2.Methords.resetChange"
+          @size-change="data2.Methords.dataList" @current-change="data2.Methords.dataList"
+          @selection-change="data2.Methords.selectionChange" />
+      </div>
+    </el-dialog>
+  </div>
 </template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+import editSkill from "@/views/base/skill/components/edit-skill.vue";
+import { getEchartData } from "@/api/report";
+import * as echarts from "echarts";
+// 数据字典相关
+const { dicts } = useDictionaryStoreHook();
+const editDialog = ref({ visible: false, title: "订单详情" });
+const key = ref(false);
+// const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+//   useCrud({
+//     src: "/api/v1/process/census/completeOrder",
+//   });
+// ;
+const data1 = ref(
+  useCrud({
+    src: "/api/v1/process/census/completeOrder",
+  })
+);
+const data2 = ref(
+  useCrud({
+    src: "/api/v1/process/census/completeSeq",
+  })
+);
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  data1.value.Methords;
 
-<script setup lang="ts"></script>
+const { selectionChange, multipleDelete } = data1.value.Methords;
+const charts = shallowRef(null);
+const chartKey = ref(false);
+const chartsData = shallowRef([]);
+const cellStyle = ({ row, column, rowIndex, columnIndex }) => {
+  if (columnIndex == 2) {
+    // return "color:'#409eff';cursor:'pointer'";
+    return "cellStyle";
+  }
+};
+const ckickCell = (row, column, cell, event) => {
+  if (column.label === "订单名称") {
+    data2.value.search.completeTime = row.completeTime;
+    data2.value.search.orderCode = row.orderCode;
+    editDialog.value.visible = true;
+  }
+};
+// 设置表格列或者其他自定义的option
+data1.value.option = Object.assign(data1.value.option, {
+  selection: false,
+  menu: false,
+  menuWidth: 100,
+  addBtn: false,
+  filterBtn: false,
+  searchShowBtn: false,
+  columnBtn: false,
+  gridBtn: false,
+  editBtn: false,
+  viewBtn: false,
+  delBtn: false,
+  column: [
+    {
+      label: "日期范围",
+      prop: "searchTime",
+      search: true,
+      hide: true,
+      type: "date",
+      format: "YYYY-MM-DD",
+      valueFormat: "YYYY-MM-DD",
+      searchRange: true,
+      startPlaceholder: "开始日期",
+      endPlaceholder: "结束日期",
+    },
+    {
+      label: "erp订单号",
+      prop: "erpCode",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "产品规格",
+      prop: "userName",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "订单编码",
+      prop: "orderCode",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "订单名称",
+      prop: "orderName",
+      width: 140,
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "项目编码",
+      prop: "projectCode",
+      width: 140,
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "订单名称",
+      prop: "orderName",
+      search: false,
+      slot: true,
+      html: true,
+      formatter: (val) => {
+        return (
+          '<span style="color:#409eff;cursor:pointer">' +
+          val.orderName +
+          "</span>"
+        );
+      },
+    },
+    {
+      label: "erp订单号",
+      prop: "erpCode",
+      search: false,
+    },
+    {
+      label: "交付日期",
+      prop: "deliverTime",
+      search: false,
+    },
+    {
+      label: "完工日期",
+      prop: "completeTime",
+      search: false,
+    },
+    {
+      label: "项目编码",
+      prop: "projectCode",
+      search: false,
+    },
+    {
+      label: "产品编码",
+      prop: "materialCode",
+      search: false,
+    },
+    {
+      label: "产品名称",
+      prop: "materialName",
+      search: false,
+    },
+    {
+      label: "产品规格",
+      prop: "materialModel",
+      search: false,
+    },
+    {
+      label: "计划总共用时",
+      prop: "planTotalTime",
+      search: false,
+    },
+    {
+      label: "实际总共用时",
+      prop: "realTotalTime",
+      search: false,
+    },
+    {
+      label: "总入库数量",
+      prop: "total",
+      search: false,
+    },
+  ],
+});
+data2.value.option = Object.assign(data2.value.option, {
+  selection: false,
+  addBtn: false,
+  filterBtn: false,
+  searchShowBtn: false,
+  menu: false,
+  addBtn: false,
+  filterBtn: false,
+  searchShowBtn: false,
+  columnBtn: false,
+  gridBtn: false,
+  editBtn: false,
+  viewBtn: false,
+  delBtn: false,
+  column: [
+    {
+      label: "交付日期",
+      prop: "deliverTime",
+      search: false,
+    },
+    {
+      label: "完工日期",
+      prop: "completeTime",
+      search: false,
+    },
+    {
+      label: "项目编码",
+      prop: "projectCode",
+      search: false,
+    },
+    {
+      label: "产品编码",
+      prop: "materialCode",
+      search: false,
+    },
+    {
+      label: "产品名称",
+      prop: "materialName",
+      search: false,
+    },
+    {
+      label: "产品规格",
+      prop: "materialModel",
+      search: false,
+    },
+    {
+      label: "计划总共用时",
+      prop: "planTotalTime",
+      search: false,
+    },
+    {
+      label: "实际总共用时",
+      prop: "realTotalTime",
+      search: false,
+    },
+    {
+      label: "总入库数量",
+      prop: "total",
+      search: false,
+    },
+  ],
+});
 
-<style scoped lang="scss"></style>
+const getCurrentMonthStartAndEndDates = () => {
+  // 获取当前日期
+  let now = new Date();
+
+  // 获取当前月份的第一天
+  let startDate = new Date(now.getFullYear(), now.getMonth(), 1);
+
+  // 获取当前月份的最后一天
+  let endDate = new Date(now.getFullYear(), now.getMonth() + 1, 0);
+
+  // 格式化日期为'YYYY-MM-DD'格式
+  function formatDate(date) {
+    let year = date.getFullYear();
+    let month = String(date.getMonth() + 1).padStart(2, "0");
+    let day = String(date.getDate()).padStart(2, "0");
+    return `${year}-${month}-${day}`;
+  }
+
+  // 返回包含开始和结束日期的数组
+  return [formatDate(startDate), formatDate(endDate)];
+};
+const chartSeriesData = shallowRef([]);
+const setChartSeries = () => {
+  let array = [];
+  for (let j = 0; j < chartsData.value.orderData.length; j++) {
+    array.push({
+      name: chartsData.value.orderData[j].orderName,
+      type: "bar",
+      barGap: 0,
+      label: labelOption,
+      emphasis: {
+        focus: "series",
+      },
+      data: chartsData.value.orderData[j].total,
+    });
+  }
+  chartSeriesData.value = array;
+};
+const echartOption = ref({
+  tooltip: {
+    trigger: "axis",
+    axisPointer: {
+      type: "shadow",
+    },
+  },
+  legend: {
+    // data: chartsData.value.orderCodes,
+    data: [],
+  },
+  xAxis: [
+    {
+      type: "category",
+      axisTick: { show: false },
+      // data: chartsData.value.dateList,
+      data: [],
+    },
+  ],
+  yAxis: [
+    {
+      type: "value",
+    },
+  ],
+  series: [],
+  // series: chartSeriesData.value,
+});
+const clickSearch = async () => {
+  await setChartsData();
+  await setChartSeries();
+  echartOption.value.legend.data = chartsData.value.orderCodes;
+  echartOption.value.xAxis[0].data = chartsData.value.dateList;
+  echartOption.value.series = chartSeriesData.value;
+  charts.value.setOption(echartOption.value, true);
+};
+//设置搜索条件中的时间范围为默认此月
+const setTime = () => {
+  data1.value.search.searchTime = getCurrentMonthStartAndEndDates();
+};
+const labelOption = {
+  show: false,
+  position: "insideBottom",
+  distance: 15,
+  align: "left",
+  verticalAlign: "middle",
+  rotate: 90,
+  formatter: "{c}  {name|{a}}",
+  fontSize: 24,
+  rich: {
+    name: {},
+  },
+};
+const setChartsData = async () => {
+  const { data } = await getEchartData(data1.value.search);
+  chartsData.value = data;
+};
+
+onMounted(async () => {
+  setTime();
+  charts.value = echarts.init(document.getElementById("dailystoragecharts"));
+  dataList();
+});
+watch(
+  () => editDialog.value.visible,
+  () => {
+    if (editDialog.value.visible == true) {
+      data2.value.Methords.dataList();
+    } else {
+      key.value = !key.value;
+    }
+  }
+);
+watch(
+  () => data1.value.data,
+  () => {
+    clickSearch();
+  }
+);
+</script>
+<style lang="scss" scoped>
+:deep(.avue-crud__left) {
+  width: 100%;
+}
+
+.cellStyle {
+  color: "#409eff" !important;
+  cursor: "pointer" !important;
+}
+
+#dailystoragecharts {
+  width: 100%;
+  height: 400px;
+  border: 1px solid #ccc;
+}
+</style>

+ 227 - 0
src/views/report/statistics/outputstatistics/index.vue

@@ -0,0 +1,227 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud ref="crudRef1" v-model:search="data1.search" :data="data1.data" :option="data1.option"
+      v-model:page="data1.page" @row-save="createRow" @row-update="updateRow" @row-del="deleteRow"
+      @search-change="searchChange" @search-reset="resetChange" @size-change="dataList" @current-change="dataList"
+      @selection-change="selectionChange" />
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+import editSkill from "@/views/base/skill/components/edit-skill.vue";
+import { getEchartData } from "@/api/report";
+import * as echarts from "echarts";
+// 数据字典相关
+const { dicts } = useDictionaryStoreHook();
+const editDialog = ref({ visible: false, title: "订单详情" });
+const key = ref(false);
+// const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+//   useCrud({
+//     src: "/api/v1/process/census/completeOrder",
+//   });
+// ;
+const data1 = ref(
+  useCrud({
+    src: "/api/v1/process/census/outputInfo",
+  })
+);
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  data1.value.Methords;
+
+const { selectionChange, multipleDelete } = data1.value.Methords;
+
+// 设置表格列或者其他自定义的option
+data1.value.option = Object.assign(data1.value.option, {
+  selection: false,
+  menuWidth: 100,
+  addBtn: false,
+  filterBtn: false,
+  searchShowBtn: false,
+  columnBtn: false,
+  gridBtn: false,
+  editBtn: false,
+  viewBtn: false,
+  delBtn: false,
+  column: [
+    {
+      label: "日期范围",
+      prop: "searchTime",
+      search: true,
+      hide: true,
+      type: "date",
+      format: "YYYY-MM-DD",
+      valueFormat: "YYYY-MM-DD",
+      searchRange: true,
+      startPlaceholder: "开始日期",
+      endPlaceholder: "结束日期",
+    },
+    {
+      label: "订单编码",
+      prop: "orderCode",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "订单名称",
+      prop: "orderName",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "物料编码",
+      prop: "materialCode",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "工单编码",
+      prop: "workOrderCode",
+      width: 140,
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "报工人员",
+      prop: "userName",
+      width: 140,
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "工序code",
+      prop: "operationCode",
+      width: 140,
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "订单名称",
+      prop: "orderName",
+      search: false,
+    },
+    {
+      label: "订单编码",
+      prop: "orderCode",
+      search: false,
+    },
+    {
+      label: "工单编码",
+      prop: "workOrderCode",
+      search: false,
+    },
+    {
+      label: "物料编码",
+      prop: "materialCode",
+      search: false,
+    },
+    {
+      label: "物料名称",
+      prop: "materialName",
+      search: false,
+    },
+    {
+      label: "物料规格",
+      prop: "materialModel",
+      search: false,
+    },
+    {
+      label: "工序编码",
+      prop: "operationCode",
+      search: false,
+    },
+    {
+      label: "工序名称",
+      prop: "operationName",
+      search: false,
+    },
+    {
+      label: "工位",
+      prop: "stationName",
+      search: false,
+    },
+    {
+      label: "流转卡号",
+      prop: "seqNo",
+      search: false,
+    },
+
+    {
+      label: "开始时间",
+      prop: "realStartWhen",
+      search: false,
+    },
+    {
+      label: "结束时间",
+      prop: "realEndWhen",
+      search: false,
+    },
+    {
+      label: "标准用时",
+      prop: "standardWorktime",
+      search: false,
+    },
+    {
+      label: "总共用时",
+      prop: "totalTime",
+      search: false,
+    },
+    {
+      label: "人员占比",
+      prop: "userTime",
+      search: false,
+    },
+  ],
+});
+
+const getCurrentMonthStartAndEndDates = () => {
+  // 获取当前日期
+  let now = new Date();
+
+  // 获取当前月份的第一天
+  let startDate = new Date(now.getFullYear(), now.getMonth(), 1);
+
+  // 获取当前月份的最后一天
+  let endDate = new Date(now.getFullYear(), now.getMonth() + 1, 0);
+
+  // 格式化日期为'YYYY-MM-DD'格式
+  function formatDate(date) {
+    let year = date.getFullYear();
+    let month = String(date.getMonth() + 1).padStart(2, "0");
+    let day = String(date.getDate()).padStart(2, "0");
+    return `${year}-${month}-${day}`;
+  }
+
+  // 返回包含开始和结束日期的数组
+  return [formatDate(startDate), formatDate(endDate)];
+};
+
+//设置搜索条件中的时间范围为默认此月
+const setTime = () => {
+  data1.value.search.searchTime = getCurrentMonthStartAndEndDates();
+};
+
+onMounted(async () => {
+  setTime();
+  dataList();
+});
+</script>
+<style lang="scss" scoped>
+:deep(.avue-crud__left) {
+  width: 100%;
+}
+</style>

+ 323 - 0
src/views/report/statistics/processanomaly/index.vue

@@ -0,0 +1,323 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud ref="crudRef1" v-model:search="data1.search" :data="data1.data" :option="data1.option"
+      v-model:page="data1.page" @row-save="createRow" @row-update="updateRow" @row-del="deleteRow"
+      @search-change="searchChange" @search-reset="resetChange" @size-change="dataList" @current-change="dataList"
+      @selection-change="selectionChange" @cell-click="ckickCell">
+      <template #menu="{ row, index, type }">
+        <el-button @click="ckickCell(row)" icon="el-icon-view" text type="primary">查看</el-button>
+      </template>
+      <template #menu-right="{}">
+        <el-button class="ml-3" @click="
+          data1.Utils.exportData(
+            '/api/v1/process/census/abnormalOperation/export'
+          )
+          ">
+          <template #icon> <i-ep-download /> </template>导出
+        </el-button>
+      </template>
+    </avue-crud>
+    <el-dialog v-model="editDialog.visible" :title="editDialog.title" width="1200px"
+      @close="editDialog.visible = false">
+      <div class="mainContentBox">
+        <avue-crud ref="crudRef2" v-model:search="data2.search" :data="data2.data" :option="data2.option"
+          v-model:page="data2.page" @row-update="data2.Methords.updateRow" @row-del="data2.Methords.deleteRow"
+          @search-change="data2.Methords.dataList" @search-reset="data2.Methords.resetChange"
+          @size-change="data2.Methords.dataList" @current-change="data2.Methords.dataList"
+          @selection-change="data2.Methords.selectionChange">
+          <template #menu-right="{}">
+            <el-button class="ml-3" @click="
+              data2.Utils.exportData(
+                '/api/v1/process/census/abnormalOperationDetails/export'
+              )
+              ">
+              <template #icon> <i-ep-download /> </template>导出
+            </el-button>
+          </template></avue-crud>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+import editSkill from "@/views/base/skill/components/edit-skill.vue";
+import { getEchartData } from "@/api/report";
+import * as echarts from "echarts";
+// 数据字典相关
+const { dicts } = useDictionaryStoreHook();
+const editDialog = ref({ visible: false, title: "订单详情" });
+const key = ref(false);
+// const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+//   useCrud({
+//     src: "/api/v1/process/census/completeOrder",
+//   });
+// ;
+const data1 = ref(
+  useCrud({
+    src: "/api/v1/process/census/abnormalOperation",
+  })
+);
+const data2 = ref(
+  useCrud({
+    src: "/api/v1/process/census/abnormalOperationDetails",
+  })
+);
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  data1.value.Methords;
+
+const { selectionChange, multipleDelete } = data1.value.Methords;
+
+const ckickCell = (row) => {
+  data2.value.search.workOrderCode = row.workOrderCode;
+  data2.value.search.searchTime = data1.value.search.searchTime;
+  editDialog.value.visible = true;
+};
+// 设置表格列或者其他自定义的option
+data1.value.option = Object.assign(data1.value.option, {
+  selection: false,
+  menu: true,
+  menuWidth: 100,
+  addBtn: false,
+  filterBtn: false,
+  searchShowBtn: false,
+  columnBtn: false,
+  gridBtn: false,
+  editBtn: false,
+  viewBtn: false,
+  delBtn: false,
+  column: [
+    {
+      label: "日期范围",
+      prop: "searchTime",
+      search: true,
+      hide: true,
+      type: "date",
+      format: "YYYY-MM-DD",
+      valueFormat: "YYYY-MM-DD",
+      searchRange: true,
+      startPlaceholder: "开始日期",
+      endPlaceholder: "结束日期",
+    },
+    {
+      label: "订单编码",
+      prop: "orderCode",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "订单名称",
+      prop: "orderName",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "物料编码",
+      prop: "materialCode",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "工单编码",
+      prop: "workOrderCode	",
+      width: 140,
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "订单名称",
+      prop: "orderName",
+      search: false,
+    },
+    {
+      label: "订单编码",
+      prop: "orderCode",
+      search: false,
+    },
+    {
+      label: "工单编码",
+      prop: "workOrderCode",
+      search: false,
+    },
+    {
+      label: "工单数量",
+      prop: "planNum",
+      search: false,
+    },
+    {
+      label: "物料编码",
+      prop: "materialCode",
+      search: false,
+    },
+    {
+      label: "物料名称",
+      prop: "materialName",
+      search: false,
+    },
+    {
+      label: "物料规格",
+      prop: "materialModel",
+      search: false,
+    },
+    {
+      label: "工序编码",
+      prop: "operationCode",
+      search: false,
+    },
+    {
+      label: "工序名称",
+      prop: "operationName",
+      search: false,
+    },
+    {
+      label: "异常数量",
+      prop: "count",
+      search: false,
+    },
+  ],
+});
+data2.value.option = Object.assign(data2.value.option, {
+  selection: false,
+  addBtn: false,
+  filterBtn: false,
+  searchShowBtn: false,
+  menu: false,
+  addBtn: false,
+  filterBtn: false,
+  searchShowBtn: false,
+  columnBtn: false,
+  gridBtn: false,
+  editBtn: false,
+  viewBtn: false,
+  delBtn: false,
+  column: [
+    {
+      label: "订单名称",
+      prop: "orderName",
+      search: false,
+    },
+    {
+      label: "订单编码",
+      prop: "orderCode",
+      search: false,
+    },
+    {
+      label: "工单编码",
+      prop: "workOrderCode",
+      search: false,
+    },
+    {
+      label: "物料编码",
+      prop: "materialCode",
+      search: false,
+    },
+    {
+      label: "物料名称",
+      prop: "materialName",
+      search: false,
+    },
+    {
+      label: "物料规格",
+      prop: "materialModel",
+      search: false,
+    },
+    {
+      label: "工序编码",
+      prop: "operationCode",
+      search: false,
+    },
+    {
+      label: "工序名称",
+      prop: "operationName",
+      search: false,
+    },
+    {
+      label: "工位",
+      prop: "stationName",
+      search: false,
+    },
+    {
+      label: "流转卡号",
+      prop: "seqNo",
+      search: false,
+    },
+    {
+      label: "开始时间",
+      prop: "realStartWhen",
+      search: false,
+    },
+    {
+      label: "结束时间",
+      prop: "realEndWhen",
+      search: false,
+    },
+    {
+      label: "标准用时",
+      prop: "standardWorktime",
+      search: false,
+    },
+    {
+      label: "总共用时",
+      prop: "totalTime",
+      search: false,
+    },
+  ],
+});
+
+const getCurrentMonthStartAndEndDates = () => {
+  // 获取当前日期
+  let now = new Date();
+
+  // 获取当前月份的第一天
+  let startDate = new Date(now.getFullYear(), now.getMonth(), 1);
+
+  // 获取当前月份的最后一天
+  let endDate = new Date(now.getFullYear(), now.getMonth() + 1, 0);
+
+  // 格式化日期为'YYYY-MM-DD'格式
+  function formatDate(date) {
+    let year = date.getFullYear();
+    let month = String(date.getMonth() + 1).padStart(2, "0");
+    let day = String(date.getDate()).padStart(2, "0");
+    return `${year}-${month}-${day}`;
+  }
+
+  // 返回包含开始和结束日期的数组
+  return [formatDate(startDate), formatDate(endDate)];
+};
+
+//设置搜索条件中的时间范围为默认此月
+const setTime = () => {
+  data1.value.search.searchTime = getCurrentMonthStartAndEndDates();
+};
+
+onMounted(async () => {
+  setTime();
+  dataList();
+});
+watch(
+  () => editDialog.value.visible,
+  () => {
+    if (editDialog.value.visible == true) {
+      data2.value.Methords.dataList();
+    } else {
+      key.value = !key.value;
+    }
+  }
+);
+</script>
+<style lang="scss" scoped>
+:deep(.avue-crud__left) {
+  width: 100%;
+}
+</style>

+ 302 - 3
src/views/report/statistics/stationBeat/index.vue

@@ -1,7 +1,306 @@
 <template>
-  <div>src/views/report/statistics/stationBeat /index</div>
+  <div class="mainContentBox">
+    <avue-crud ref="crudRef1" v-model:search="data1.search" :data="data1.data" :option="data1.option"
+      v-model:page="data1.page" @row-update="updateRow" @row-del="deleteRow" @search-change="dataList"
+      @search-reset="resetChange" @size-change="dataList" @current-change="dataList"
+      @selection-change="selectionChange">
+      <template #header="{ size }">
+        <div id="dailystoragecharts"></div>
+      </template>
+      <template #menu-right="{}">
+        <el-button class="ml-3" @click="exportData('/api/v1/process/census/beatInfo/export')">
+          <template #icon> <i-ep-download /> </template>导出
+        </el-button>
+      </template>
+    </avue-crud>
+  </div>
 </template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+import editSkill from "@/views/base/skill/components/edit-skill.vue";
+import { getBeatInfo } from "@/api/report";
+import * as echarts from "echarts";
+// 数据字典相关
+const { dicts } = useDictionaryStoreHook();
+// const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+//   useCrud({
+//     src: "/api/v1/process/census/completeOrder",
+//   });
+// ;
+const data1 = ref(
+  useCrud({
+    src: "/api/v1/process/census/beatInfo",
+  })
+);
 
-<script setup lang="ts"></script>
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  data1.value.Methords;
 
-<style scoped lang="scss"></style>
+const { selectionChange, multipleDelete } = data1.value.Methords;
+const { checkBtnPerm, downloadTemplate, exportData } = data1.value.Utils;
+const charts = shallowRef(null);
+const chartsData = ref([]);
+
+// 设置表格列或者其他自定义的option
+data1.value.option = Object.assign(data1.value.option, {
+  selection: true,
+  menu: false,
+  menuWidth: 100,
+  addBtn: false,
+  filterBtn: false,
+  searchShowBtn: false,
+  columnBtn: false,
+  gridBtn: false,
+  editBtn: false,
+  viewBtn: false,
+  delBtn: false,
+  column: [
+    {
+      label: "日期范围",
+      prop: "searchTime",
+      search: true,
+      hide: true,
+      type: "date",
+      format: "YYYY-MM-DD",
+      valueFormat: "YYYY-MM-DD",
+      searchRange: true,
+      startPlaceholder: "开始日期",
+      endPlaceholder: "结束日期",
+    },
+    {
+      label: "订单编码",
+      prop: "orderCode",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "物料编码",
+      prop: "materialCode",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "工单编码",
+      prop: "workOrderCode",
+      width: 140,
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    //展示
+    {
+      label: "订单编码",
+      prop: "orderCode",
+      search: false,
+    },
+    {
+      label: "订单名称",
+      prop: "orderName",
+      search: false,
+    },
+    {
+      label: "工单编码",
+      prop: "workOrderCode",
+      search: false,
+    },
+    {
+      label: "工单数量",
+      prop: "planNum",
+      search: false,
+    },
+    {
+      label: "物料编码",
+      prop: "materialCode",
+      search: false,
+    },
+    {
+      label: "物料名称",
+      prop: "materialName",
+      search: false,
+    },
+    {
+      label: "物料规格",
+      prop: "materialModel",
+      search: false,
+    },
+    {
+      label: "标准用时",
+      prop: "standardWorktime",
+      search: false,
+    },
+    {
+      label: "总共用时",
+      prop: "totalTime",
+      search: false,
+    },
+    {
+      label: "时差比",
+      prop: "totalTime",
+      search: false,
+      html: true,
+      formatter: (val) => {
+        return (
+          "<span>" +
+          (Number(val.totalTime) - Number(val.standardWorktime)) +
+          "</span>"
+        );
+      },
+    },
+  ],
+});
+
+const getCurrentMonthStartAndEndDates = () => {
+  // 获取当前日期
+  let now = new Date();
+
+  // 获取当前月份的第一天
+  let startDate = new Date(now.getFullYear(), now.getMonth(), 1);
+
+  // 获取当前月份的最后一天
+  let endDate = new Date(now.getFullYear(), now.getMonth() + 1, 0);
+
+  // 格式化日期为'YYYY-MM-DD'格式
+  function formatDate(date) {
+    let year = date.getFullYear();
+    let month = String(date.getMonth() + 1).padStart(2, "0");
+    let day = String(date.getDate()).padStart(2, "0");
+    return `${year}-${month}-${day}`;
+  }
+
+  // 返回包含开始和结束日期的数组
+  return [formatDate(startDate), formatDate(endDate)];
+};
+const clickSearch = async () => {
+  await setChartsData();
+  setOption();
+  charts.value.setOption(
+    {
+      tooltip: {
+        trigger: "axis",
+        axisPointer: {
+          type: "shadow",
+        },
+      },
+      legend: {
+        data: ["标准用时", "总共用时", "时差比"],
+      },
+      xAxis: [
+        {
+          type: "category",
+          axisTick: { show: false },
+          data: chartOption.value.xData,
+        },
+      ],
+      yAxis: [
+        {
+          type: "value",
+        },
+      ],
+      series: chartOption.value.series,
+    },
+    true
+  );
+};
+//设置搜索条件中的时间范围为默认此月
+const setTime = () => {
+  data1.value.search.searchTime = getCurrentMonthStartAndEndDates();
+};
+const labelOption = {
+  show: false,
+  position: "insideBottom",
+  distance: 15,
+  align: "left",
+  verticalAlign: "middle",
+  rotate: 90,
+  formatter: "{c}  {name|{a}}",
+  fontSize: 24,
+  rich: {
+    name: {},
+  },
+};
+const chartOption = ref({
+  xData: [],
+  series: [],
+});
+const setChartsData = async () => {
+  const { data } = await getBeatInfo({
+    ...data1.value.search,
+    pageSize: 99999,
+  });
+  chartsData.value = data.records;
+};
+const setOption = () => {
+  let array1 = [];
+  let array2 = [];
+  let obj1 = {
+    name: "标准用时",
+    type: "bar",
+    barGap: 0,
+    label: labelOption,
+    emphasis: {
+      focus: "series",
+    },
+    data: [],
+  };
+  let obj2 = {
+    name: "总共用时",
+    type: "bar",
+    barGap: 0,
+    label: labelOption,
+    emphasis: {
+      focus: "series",
+    },
+    data: [],
+  };
+  let obj3 = {
+    name: "时差比",
+    type: "bar",
+    barGap: 0,
+    label: labelOption,
+    emphasis: {
+      focus: "series",
+    },
+    data: [],
+  };
+  chartsData.value.forEach((item) => {
+    array1.push(`${item.orderName}:${item.workOrderCode}`);
+    obj1.data.push(item.standardWorktime);
+    obj2.data.push(item.totalTime);
+    obj3.data.push(Number(item.totalTime) - Number(item.standardWorktime));
+  });
+  array2 = [obj1, obj2, obj3];
+  chartOption.value.xData = array1;
+  chartOption.value.series = array2;
+};
+
+onMounted(async () => {
+  setTime();
+  charts.value = echarts.init(document.getElementById("dailystoragecharts"));
+  dataList();
+  clickSearch();
+});
+</script>
+<style lang="scss" scoped>
+:deep(.avue-crud__left) {
+  width: 100%;
+}
+
+.cellStyle {
+  color: "#409eff" !important;
+  cursor: "pointer" !important;
+}
+
+#dailystoragecharts {
+  width: 100%;
+  height: 400px;
+  border: 1px solid #ccc;
+}
+</style>

+ 323 - 0
src/views/report/statistics/workeveryday/index.vue

@@ -0,0 +1,323 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud ref="crudRef1" v-model:search="data1.search" :data="data1.data" :option="data1.option"
+      v-model:page="data1.page" @row-save="createRow" @row-update="updateRow" @row-del="deleteRow"
+      @search-change="searchChange" @search-reset="resetChange" @size-change="dataList" @current-change="dataList"
+      @selection-change="selectionChange" @cell-click="ckickCell">
+      <template #menu="{ row, index, type }">
+        <el-button @click="ckickCell(row)" icon="el-icon-view" text type="primary">查看</el-button>
+      </template>
+      <template #menu-right="{}">
+        <el-button class="ml-3" @click="
+          data1.Utils.exportData(
+            '/api/v1/process/census/abnormalOperation/export'
+          )
+          ">
+          <template #icon> <i-ep-download /> </template>导出
+        </el-button>
+      </template>
+    </avue-crud>
+    <el-dialog v-model="editDialog.visible" :title="editDialog.title" width="1200px"
+      @close="editDialog.visible = false">
+      <div class="mainContentBox">
+        <avue-crud ref="crudRef2" v-model:search="data2.search" :data="data2.data" :option="data2.option"
+          v-model:page="data2.page" @row-update="data2.Methords.updateRow" @row-del="data2.Methords.deleteRow"
+          @search-change="data2.Methords.dataList" @search-reset="data2.Methords.resetChange"
+          @size-change="data2.Methords.dataList" @current-change="data2.Methords.dataList"
+          @selection-change="data2.Methords.selectionChange">
+          <template #menu-right="{}">
+            <el-button class="ml-3" @click="
+              data2.Utils.exportData(
+                '/api/v1/process/census/abnormalOperationDetails/export'
+              )
+              ">
+              <template #icon> <i-ep-download /> </template>导出
+            </el-button>
+          </template></avue-crud>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+import editSkill from "@/views/base/skill/components/edit-skill.vue";
+import { getEchartData } from "@/api/report";
+import * as echarts from "echarts";
+// 数据字典相关
+const { dicts } = useDictionaryStoreHook();
+const editDialog = ref({ visible: false, title: "订单详情" });
+const key = ref(false);
+// const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+//   useCrud({
+//     src: "/api/v1/process/census/completeOrder",
+//   });
+// ;
+const data1 = ref(
+  useCrud({
+    src: "/api/v1/process/census/completeOperation",
+  })
+);
+const data2 = ref(
+  useCrud({
+    src: "/api/v1/process/census/abnormalOperationDetails",
+  })
+);
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  data1.value.Methords;
+
+const { selectionChange, multipleDelete } = data1.value.Methords;
+
+const ckickCell = (row) => {
+  data2.value.search.workOrderCode = row.workOrderCode;
+  data2.value.search.searchTime = data1.value.search.searchTime;
+  editDialog.value.visible = true;
+};
+// 设置表格列或者其他自定义的option
+data1.value.option = Object.assign(data1.value.option, {
+  selection: false,
+  menu: true,
+  menuWidth: 100,
+  addBtn: false,
+  filterBtn: false,
+  searchShowBtn: false,
+  columnBtn: false,
+  gridBtn: false,
+  editBtn: false,
+  viewBtn: false,
+  delBtn: false,
+  column: [
+    {
+      label: "日期范围",
+      prop: "searchTime",
+      search: true,
+      hide: true,
+      type: "date",
+      format: "YYYY-MM-DD",
+      valueFormat: "YYYY-MM-DD",
+      searchRange: true,
+      startPlaceholder: "开始日期",
+      endPlaceholder: "结束日期",
+    },
+    {
+      label: "订单编码",
+      prop: "orderCode",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "订单名称",
+      prop: "orderName",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "项目编码",
+      prop: "projectCode",
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "产品规格",
+      prop: "materialModel",
+      width: 140,
+      overHidden: true,
+      search: true,
+      editDisabled: true,
+      hide: true,
+    },
+    {
+      label: "订单名称",
+      prop: "orderName",
+      search: false,
+    },
+    {
+      label: "订单编码",
+      prop: "orderCode",
+      search: false,
+    },
+    {
+      label: "项目编码",
+      prop: "projectCode",
+      search: false,
+    },
+    {
+      label: "物料编码",
+      prop: "materialCode",
+      search: false,
+    },
+    {
+      label: "物料名称",
+      prop: "materialName",
+      search: false,
+    },
+    {
+      label: "物料规格",
+      prop: "materialModel",
+      search: false,
+    },
+    {
+      label: "工序编码",
+      prop: "operationCode",
+      search: false,
+    },
+    {
+      label: "工序名称",
+      prop: "operationName",
+      search: false,
+    },
+    {
+      label: "完工日期",
+      prop: "realEndWhen",
+      search: false,
+    },
+    {
+      label: "总完工数量",
+      prop: "total",
+      search: false,
+    },
+  ],
+});
+data2.value.option = Object.assign(data2.value.option, {
+  selection: false,
+  addBtn: false,
+  filterBtn: false,
+  searchShowBtn: false,
+  menu: false,
+  addBtn: false,
+  filterBtn: false,
+  searchShowBtn: false,
+  columnBtn: false,
+  gridBtn: false,
+  editBtn: false,
+  viewBtn: false,
+  delBtn: false,
+  column: [
+    {
+      label: "订单名称",
+      prop: "orderName",
+      search: false,
+    },
+    {
+      label: "订单编码",
+      prop: "orderCode",
+      search: false,
+    },
+    {
+      label: "工单编码",
+      prop: "workOrderCode",
+      search: false,
+    },
+    {
+      label: "物料编码",
+      prop: "materialCode",
+      search: false,
+    },
+    {
+      label: "物料名称",
+      prop: "materialName",
+      search: false,
+    },
+    {
+      label: "物料规格",
+      prop: "materialModel",
+      search: false,
+    },
+    {
+      label: "工序编码",
+      prop: "operationCode",
+      search: false,
+    },
+    {
+      label: "工序名称",
+      prop: "operationName",
+      search: false,
+    },
+    {
+      label: "工位",
+      prop: "stationName",
+      search: false,
+    },
+    {
+      label: "流转卡号",
+      prop: "seqNo",
+      search: false,
+    },
+    {
+      label: "开始时间",
+      prop: "realStartWhen",
+      search: false,
+    },
+    {
+      label: "结束时间",
+      prop: "realEndWhen",
+      search: false,
+    },
+    {
+      label: "标准用时",
+      prop: "standardWorktime",
+      search: false,
+    },
+    {
+      label: "总共用时",
+      prop: "totalTime",
+      search: false,
+    },
+  ],
+});
+
+const getCurrentMonthStartAndEndDates = () => {
+  // 获取当前日期
+  let now = new Date();
+
+  // 获取当前月份的第一天
+  let startDate = new Date(now.getFullYear(), now.getMonth(), 1);
+
+  // 获取当前月份的最后一天
+  let endDate = new Date(now.getFullYear(), now.getMonth() + 1, 0);
+
+  // 格式化日期为'YYYY-MM-DD'格式
+  function formatDate(date) {
+    let year = date.getFullYear();
+    let month = String(date.getMonth() + 1).padStart(2, "0");
+    let day = String(date.getDate()).padStart(2, "0");
+    return `${year}-${month}-${day}`;
+  }
+
+  // 返回包含开始和结束日期的数组
+  return [formatDate(startDate), formatDate(endDate)];
+};
+
+//设置搜索条件中的时间范围为默认此月
+const setTime = () => {
+  data1.value.search.searchTime = getCurrentMonthStartAndEndDates();
+};
+
+onMounted(async () => {
+  setTime();
+  dataList();
+});
+watch(
+  () => editDialog.value.visible,
+  () => {
+    if (editDialog.value.visible == true) {
+      data2.value.Methords.dataList();
+    } else {
+      key.value = !key.value;
+    }
+  }
+);
+</script>
+<style lang="scss" scoped>
+:deep(.avue-crud__left) {
+  width: 100%;
+}
+</style>