ezhizao\ezhizao_zx 1 gadu atpakaļ
vecāks
revīzija
9015ffd5cb

+ 12 - 1
src/api/business/daywork.js

@@ -149,7 +149,18 @@ export function listDayworkItem(query) {
 		params: query
 	})
 }
-
+/**
+ * 批次日报
+ * @param {*} query 
+ * @returns 
+ */
+export function listReportItem(query) {
+	return request({
+		url: baseUrl + '/business/productionDaywork/listReportItem',
+		method: 'get',
+		params: query
+	})
+}
 /**
  * 获取 生产批次报工 列表
  * @param {*} data

+ 8 - 0
src/api/business/equipment.js

@@ -88,6 +88,14 @@ export function listDetails(data) {
   })
 }
 
+export function listCategories(data) {
+  return request({
+    url: baseUrl + '/business/equipmentCategory/listCategories',
+    method: 'post',
+    data: data
+  })
+}
+
 // 查询设备详情列表
 export function detailList(query) {
   return request({

+ 10 - 0
src/api/business/productionPlanDetail.js

@@ -13,6 +13,16 @@ export function listProductionPlanDetail(query) {
   })
 }
 
+// 查询生产计划明细报表列表
+export function reportListPlanDetail(query) {
+  return request({
+    url: baseUrl + '/business/productionPlanDetail/reportList',
+    method: 'get',
+    params: query
+  })
+}
+
+
 // 查询生产计划明细列表
 export function listProductionPlanDetailList(query) {
   return request({

+ 469 - 0
src/views/business/equipment/0608index.vue

@@ -0,0 +1,469 @@
+<template>
+  <div class="page-container row-container">
+    <!-- 左侧区域 -->
+    <section class="list-part-container">
+      <!-- 搜索区域 -->
+      <el-form class="list-search-container" :inline="true">
+        <el-form-item class="section-title" label="设备类别" />
+        <el-form-item label="设备类别名称:">
+          <el-input
+            placeholder="请输入设备类别名称"
+            v-model.trim="name"
+            clearable
+            style="width: 180px"
+            @keydown.enter.prevent
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button
+            type="primary"
+            icon="Plus"
+            v-hasPermi="['business:equipment:add']"
+            @click="handleShowEquipmentCategoryDialog(null)"
+          >
+            新增
+          </el-button>
+        </el-form-item>
+      </el-form>
+      <!-- 设备类别列表区域 -->
+      <div class="el-table-container">
+        <div class="el-table-inner-container">
+          <el-tree
+            ref="categoryTable"
+            v-loading="equipmentCategoryLoading"
+            :data="equipmentCategoryList"
+            :props="{ label: 'name', children: 'children' }"
+            :expand-on-click-node="false"
+            :filter-node-method="filterNode"
+            default-expand-all
+            node-key="id"
+            highlight-current
+            style="max-height: 100%; overflow-y: auto; margin-bottom: 20px"
+            @node-click="handleCurrentCategoryChange"
+          >
+            <template #default="{ node, data }">
+              <div
+                style="
+                  display: flex;
+                  width: 100%;
+                  justify-content: space-between;
+                "
+              >
+                <span>{{ node.label }}</span>
+                <span>
+                  <el-button
+                    link
+                    type="warning"
+                    icon="Edit"
+                    @click="handleShowEquipmentCategoryDialog(data)"
+                    v-hasPermi="['business:equipment:edit']"
+                    >编辑
+                  </el-button>
+                  <el-button
+                    link
+                    type="danger"
+                    icon="Delete"
+                    @click="handleDeleteCategory(data)"
+                    v-hasPermi="['business:equipment:remove']"
+                    >删除
+                  </el-button>
+                </span>
+              </div>
+            </template>
+          </el-tree>
+        </div>
+      </div>
+      <!-- <pagination
+        v-show="equipmentCategoryTotal > 0"
+        :total="equipmentCategoryTotal"
+        :pager-count="4"
+        v-model:page="queryEquipmentCategoryParams.pageNum"
+        v-model:limit="queryEquipmentCategoryParams.pageSize"
+        @pagination="getCategoryList"
+      /> -->
+    </section>
+
+    <!-- 右侧区域 -->
+    <section class="list-part-container" style="flex: 2">
+      <!-- 搜索区域 -->
+      <el-form
+        class="list-search-container"
+        :model="queryParams"
+        ref="queryRef"
+        :inline="true"
+      >
+        <el-form-item class="section-title" label="设备档案管理" />
+        <el-form-item label="设备编码:">
+          <el-input
+            placeholder="请输入设备编码"
+            v-model.trim="queryParams.equipmentCode"
+            @keydown.enter.prevent
+            :disabled="equipmentCategoryList.length == 0"
+            clearable
+            style="width: 180px"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button
+            type="info"
+            icon="Search"
+            :disabled="equipmentCategoryList.length == 0"
+            @click="handleRefreshEquipment"
+            >搜索</el-button
+          >
+        </el-form-item>
+        <el-form-item>
+          <el-button
+            type="primary"
+            icon="Plus"
+            :disabled="equipmentCategoryList.length == 0"
+            @click="handleShowEquipmentDetailDialog(null)"
+            v-hasPermi="['business:equipment:add']"
+            >新增</el-button
+          >
+        </el-form-item>
+        <!-- <el-form-item>
+          <el-button
+            :disabled="selections.length == 0"
+            type="warning"
+            icon="Download"
+            @click="handleDownloadQrCode"
+            >下载设备档案二维码</el-button
+          >
+        </el-form-item> -->
+      </el-form>
+      <!-- 列表区域 -->
+      <div class="el-table-container">
+        <div class="el-table-inner-container">
+          <el-table
+            ref="equipmentTable"
+            v-loading="equipmentLoading"
+            row-key="id"
+            @selection-change="handleSelectionChange"
+            :data="equipmentDetailList"
+            height="100%"
+          >
+            <el-table-column
+              type="selection"
+              width="40"
+              align="center"
+              :reserve-selection="true"
+            />
+            <el-table-column
+              label="行号"
+              type="index"
+              width="50"
+              align="center"
+            />
+            <el-table-column
+              label="设备编码"
+              prop="equipmentCode"
+              width="120"
+              align="center"
+            />
+            <el-table-column
+              label="设备名称"
+              prop="equipmentName"
+              width="250"
+              align="center"
+            />
+            <el-table-column
+              label="归属部门"
+              prop="belongingDeptAlias"
+              width="100"
+              align="center"
+            />
+            <el-table-column
+              label="使用部门"
+              prop="usageDeptAlias"
+              width="100"
+              align="center"
+            />
+            <el-table-column
+              label="设备状态"
+                prop="equipmentStatusCode"
+                width="100"
+                align="center"
+            >
+              <template #default="scope">
+                <dict-tag :options="equipment_status" :value="scope.row.equipmentStatusCode"/>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="虚拟设备"
+                prop="isVirtualEquipment"
+                width="100"
+                align="center"
+            >
+              <template #default="scope">
+                <dict-tag :options="yes_no" :value="scope.row.isVirtualEquipment"/>
+              </template>
+            </el-table-column>
+            <el-table-column label="备注" prop="remark" align="center" />
+            <el-table-column label="操作" width="150" align="center">
+              <template #default="scope">
+                <el-button
+                  v-hasPermi="['business:equipmentDetail:edit']"
+                  link
+                  type="warning"
+                  icon="Edit"
+                  @click="handleShowEquipmentDetailDialog(scope.row.id)"
+                >
+                  编辑
+                </el-button>
+                <el-button
+                  v-hasPermi="['business:equipmentDetail:remove']"
+                  link
+                  type="danger"
+                  icon="Delete"
+                  @click="handleDeleteEquipmentDetail(scope.row.id)"
+                >
+                  删除
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <pagination
+        v-show="equipmentTotal > 0"
+        :total="equipmentTotal"
+        v-model:page="queryParams.pageNum"
+        v-model:limit="queryParams.pageSize"
+        @pagination="getEquipmentList"
+      />
+    </section>
+    <!-- 设备类别表单 -->
+    <equipment-category-form
+      ref="categoryRef"
+      @handleSaveSuccess="handleRefreshCategory"
+    />
+    <!-- 设备档案管理表单 -->
+    <equipment-detail-form
+      ref="detailRef"
+      @handleSaveSuccess="handleRefreshDetail"
+    />
+  </div>
+</template>
+
+<script setup name="Equipment">
+import equipmentCategoryForm from "./formCategory";
+import equipmentDetailForm from "./formDetail";
+import {
+  listCategory,
+  delCategory,
+  detailList,
+  delDetails,
+} from "@/api/business/equipment";
+const { proxy } = getCurrentInstance();
+const webHost = import.meta.env.VITE_APP_PRODUCTION_API;
+/**字典数组 */
+const { equipment_status } = proxy.useDict("equipment_status");
+const { yes_no } = proxy.useDict("yes_no");
+/** 设备类别*/
+const categoryTable = ref(null);
+const currentCategory = ref({});
+const equipmentCategoryList = ref([]);
+const equipmentCategoryTotal = ref(0);
+const name = ref("");
+/** 设备档案管理 */
+const selections = ref([]);
+const equipmentTable = ref(null);
+const equipmentTotal = ref(0);
+const equipmentDetailList = ref([]);
+const equipmentLoading = ref(false);
+const equipmentCategoryLoading = ref(true);
+
+/** 设备类别 查询对象 */
+const queryEquipmentCategoryParams = ref({
+  name: "",
+});
+
+/** 设备档案 查询对象 */
+const queryParams = ref({
+  categoryId: 0,
+  keywords: "",
+  pageNum: 1,
+  pageSize: 10,
+});
+
+/****************************************************  生命周期函数区  ****************************************************/
+onMounted(() => {
+  getCategoryList();
+});
+/****************************************************  方法区  ****************************************************/
+
+/****************************** 设备类别 事件处理区 ******************************/
+/** 获取设备分类列表 */
+const getCategoryList = () => {
+  queryParams.value.categoryId = null;
+  equipmentCategoryLoading.value = true;
+  listCategory(queryEquipmentCategoryParams.value).then((response) => {
+    equipmentCategoryList.value = response.rows;
+    equipmentCategoryTotal.value = response.total;
+    console.log(equipmentCategoryList.value.length);
+    if (equipmentCategoryList.value.length > 0) {
+      currentCategory.value = equipmentCategoryList.value[0];
+      nextTick(() => {
+        proxy.$refs.categoryTable.setCurrentKey(currentCategory.value.id);
+        handleCurrentCategoryChange(currentCategory.value);
+      });
+    } else {
+      currentCategory.value = {};
+      equipmentDetailList.value = [];
+    }
+    equipmentCategoryLoading.value = false;
+  });
+};
+/** 打开设备档案详情表单 */
+const handleShowEquipmentDetailDialog = (id) => {
+  if (id) {
+    var detailInfo = equipmentDetailList.value.filter((item) => item.id !== id);
+    var equipmentCodeIds = detailInfo.map((item) => item.equipmentCode);
+  } else {
+    var equipmentCodeIds = equipmentDetailList.value.map(
+      (item) => item.equipmentCode
+    );
+  }
+
+  let data = {
+    equipmentCategoryId: currentCategory.value.id,
+    id: id,
+    equipmentCode: equipmentCodeIds,
+  };
+  proxy.$refs.detailRef.open(data);
+};
+
+/**删除设备明细 */
+const handleDeleteEquipmentDetail = (id) => {
+  proxy.$modal
+    .confirm("确定删除数据项?")
+    .then(() => {
+      delDetails(id).then(res => {
+        if (res.code === 200) {
+          proxy.$modal.msgSuccess("操作成功!");
+          handleCurrentCategoryChange(currentCategory.value);
+        }
+      });
+    })
+    .catch(() => {});
+};
+/** 刷新设备分类列表 */
+const handleRefreshCategory = () => {
+  getCategoryList();
+};
+//设备类别搜索,前端过滤
+watch(name, (val) => {
+  equipmentDetailList.value = [];
+  equipmentTotal.value = 0;
+  proxy.$refs["categoryTable"].filter(val);
+});
+const filterNode = (value, data) => {
+  if (!value) {
+    return true;
+  }
+  queryParams.value.equipmentCode = "";
+  return data.name.indexOf(value) !== -1;
+};
+//删除设备类别
+const handleDeleteCategory = (data) => {
+  var showErrorMessage = false;
+  proxy.$modal
+    .confirm("确定删除数据项?")
+    .then(() => {
+      if (data.children) {
+        showErrorMessage = true;
+        return Promise.reject(new Error("HasChildrenError"));
+      }
+      return delCategory(data.id);
+    })
+    .then(() => {
+      if (!showErrorMessage) {
+        handleRefreshCategory();
+        proxy.$modal.msgSuccess("操作成功!");
+      }
+    })
+    .catch(() => {})
+    .finally(() => {
+      if (showErrorMessage) {
+        proxy.$modal.msgError("该设备类别下有子类别,不能删除!");
+      }
+    });
+};
+
+/** 设备类别表格 current-change 事件 */
+function handleCurrentCategoryChange(row) {
+  if (row) {
+    currentCategory.value = row;
+    queryParams.value.equipmentCategoryId = row.id;
+    getEquipmentList();
+  }
+}
+
+/** 打开设备分类表单 */
+const handleShowEquipmentCategoryDialog = (data) => {
+  if (data) {
+    proxy.$refs.categoryRef.open(data.id);
+  }
+  proxy.$refs.categoryRef.open();
+};
+
+/****************************** 设备档案 事件处理区 ******************************/
+
+/** 搜索按钮操作 */
+function handleRefreshEquipment() {
+  getEquipmentList();
+}
+/** 获取设备档案列表 */
+const getEquipmentList = () => {
+  equipmentLoading.value = true;
+  console.log(queryParams.value);
+  if (queryParams.value.equipmentCategoryId) {
+    detailList(queryParams.value).then((res) => {
+      equipmentDetailList.value = res.rows;
+      equipmentLoading.value = false;
+      equipmentTotal.value = res.total;
+    });
+  }
+};
+//刷新设备档案管理
+function handleRefreshDetail() {
+  getEquipmentList();
+}
+/**
+ * 列表checkbox列选择 事件
+ */
+function handleSelectionChange(selection) {
+  selections.value = selection;
+}
+/** 设备档案管理二维码 */
+function handleDownloadQrCode() {
+  /** 批量下载二维码 */
+  for (var i = 0; i < selections.value.length; i++) {
+    // window.open(webHost + selections.value[i].qcCode)
+
+    var link = document.createElement("a");
+    link.href = webHost + selections.value[i].qcCode;
+    link.download = selections.value[i].equipmentCode; // 可以根据需要设置下载的文件名
+    link.target = "_blank"; // 可以根据需要选择是否在新窗口中下载
+    link.click();
+  }
+}
+</script>
+<style scoped>
+:deep(.el-tree-node__label) {
+  font-size: 14px !important;
+  display: inline-block;
+  width: 100%;
+}
+:deep(.el-tree-node__content) {
+  height: 40px;
+  border-bottom: 1px solid #ebeef5;
+  padding: 8px 0;
+  line-height: 23px;
+}
+.move-handle {
+  cursor: move;
+  background-color: #eee;
+}
+</style>

+ 197 - 0
src/views/business/equipment/category.vue

@@ -0,0 +1,197 @@
+<template>
+    <div class="page-container row-container">
+        <!-- 左侧区域 -->
+        <section class="list-part-container">
+            <!-- 搜索区域 -->
+            <el-form class="list-search-container" :inline="true">
+                <el-form-item class="section-title" label="设备类别" />
+                <el-form-item label="设备类别名称:">
+                    <el-input placeholder="请输入设备类别名称" v-model.trim="name" clearable style="width: 180px"
+                        @keydown.enter.prevent />
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="primary" icon="Plus" v-hasPermi="['business:equipment:add']"
+                        @click="handleShowEquipmentCategoryDialog(null)">
+                        新增
+                    </el-button>
+                </el-form-item>
+            </el-form>
+            <!-- 设备类别列表区域 -->
+            <div class="el-table-container">
+                <div class="el-table-inner-container">
+                    <el-tree ref="categoryTable" v-loading="equipmentCategoryLoading" :data="equipmentCategoryList"
+                        :props="{ label: 'name', children: 'children' }" :expand-on-click-node="false"
+                        :filter-node-method="filterNode" default-expand-all node-key="id" highlight-current
+                        style="max-height: 100%; overflow-y: auto; margin-bottom: 20px">
+                        <template #default="{ node, data }">
+                            <div style="
+                        display: flex;
+                        width: 100%;
+                        justify-content: space-between;
+                      ">
+                                <span>{{ node.label }}</span>
+                                <span>
+                                    <el-button link type="warning" icon="Edit"
+                                        @click="handleShowEquipmentCategoryDialog(data)"
+                                        v-hasPermi="['business:equipment:edit']">编辑
+                                    </el-button>
+                                    <el-button link type="danger" icon="Delete" @click="handleDeleteCategory(data)"
+                                        v-hasPermi="['business:equipment:remove']">删除
+                                    </el-button>
+                                </span>
+                            </div>
+                        </template>
+                    </el-tree>
+                </div>
+            </div>
+            <!-- <pagination
+          v-show="equipmentCategoryTotal > 0"
+          :total="equipmentCategoryTotal"
+          :pager-count="4"
+          v-model:page="queryEquipmentCategoryParams.pageNum"
+          v-model:limit="queryEquipmentCategoryParams.pageSize"
+          @pagination="getCategoryList"
+        /> -->
+        </section>
+
+      
+        <!-- 设备类别表单 -->
+        <equipment-category-form ref="categoryRef" @handleSaveSuccess="handleRefreshCategory" />
+    </div>
+</template>
+  
+<script setup name="Equipment">
+import equipmentCategoryForm from "./formCategory";
+import equipmentDetailForm from "./formDetail";
+import {
+    listCategory,
+    delCategory,
+    detailList,
+    delDetails,
+} from "@/api/business/equipment";
+const { proxy } = getCurrentInstance();
+const webHost = import.meta.env.VITE_APP_PRODUCTION_API;
+/**字典数组 */
+const { equipment_status } = proxy.useDict("equipment_status");
+const { yes_no } = proxy.useDict("yes_no");
+/** 设备类别*/
+const categoryTable = ref(null);
+const currentCategory = ref({});
+const equipmentCategoryList = ref([]);
+const equipmentCategoryTotal = ref(0);
+const name = ref("");
+/** 设备档案管理 */
+const selections = ref([]);
+const equipmentTable = ref(null);
+const equipmentTotal = ref(0);
+const equipmentLoading = ref(false);
+const equipmentCategoryLoading = ref(true);
+
+/** 设备类别 查询对象 */
+const queryEquipmentCategoryParams = ref({
+    name: "",
+});
+
+/** 设备档案 查询对象 */
+const queryParams = ref({
+    categoryId: 0,
+    keywords: "",
+    pageNum: 1,
+    pageSize: 10,
+});
+
+/****************************************************  生命周期函数区  ****************************************************/
+onMounted(() => {
+    getCategoryList();
+});
+/****************************************************  方法区  ****************************************************/
+
+/****************************** 设备类别 事件处理区 ******************************/
+/** 获取设备分类列表 */
+const getCategoryList = () => {
+    queryParams.value.categoryId = null;
+    equipmentCategoryLoading.value = true;
+    listCategory(queryEquipmentCategoryParams.value).then((response) => {
+        equipmentCategoryList.value = response.rows;
+        equipmentCategoryTotal.value = response.total;
+        console.log(equipmentCategoryList.value.length);
+        
+        equipmentCategoryLoading.value = false;
+    });
+};
+
+
+/** 刷新设备分类列表 */
+const handleRefreshCategory = () => {
+    getCategoryList();
+};
+//设备类别搜索,前端过滤
+watch(name, (val) => {
+    equipmentTotal.value = 0;
+    proxy.$refs["categoryTable"].filter(val);
+});
+const filterNode = (value, data) => {
+    if (!value) {
+        return true;
+    }
+    queryParams.value.equipmentCode = "";
+    return data.name.indexOf(value) !== -1;
+};
+//删除设备类别
+const handleDeleteCategory = (data) => {
+    var showErrorMessage = false;
+    proxy.$modal
+        .confirm("确定删除数据项?")
+        .then(() => {
+            if (data.children) {
+                showErrorMessage = true;
+                return Promise.reject(new Error("HasChildrenError"));
+            }
+            return delCategory(data.id);
+        })
+        .then(() => {
+            if (!showErrorMessage) {
+                handleRefreshCategory();
+                proxy.$modal.msgSuccess("操作成功!");
+            }
+        })
+        .catch(() => { })
+        .finally(() => {
+            if (showErrorMessage) {
+                proxy.$modal.msgError("该设备类别下有子类别,不能删除!");
+            }
+        });
+};
+
+
+
+/** 打开设备分类表单 */
+const handleShowEquipmentCategoryDialog = (data) => {
+    if (data) {
+        proxy.$refs.categoryRef.open(data.id);
+    }
+    proxy.$refs.categoryRef.open();
+};
+
+
+</script>
+<style scoped>
+:deep(.el-tree-node__label) {
+    font-size: 14px !important;
+    display: inline-block;
+    width: 100%;
+}
+
+:deep(.el-tree-node__content) {
+    height: 40px;
+    border-bottom: 1px solid #ebeef5;
+    padding: 8px 0;
+    line-height: 23px;
+}
+
+.move-handle {
+    cursor: move;
+    background-color: #eee;
+}
+</style>
+  

+ 29 - 27
src/views/business/equipment/formDetail.vue

@@ -1,7 +1,12 @@
 <template>
   <el-dialog title="设备清单表单" v-model="visible" width="400px" height="500px" append-to-body draggable>
     <div class="form-container">
-      <el-form ref="formDetailRef" v-loading="loading" class="master-container" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="formDetailRef" v-loading="loading" class="master-container" :model="form" :rules="rules"
+        label-width="80px">
+        <el-form-item label="设备类别" prop="equipmentCategoryId">
+          <el-select-v2 v-model="form.equipmentCategoryId"  filterable :options="parentCategories"
+            placeholder="设备类别" style="width: 220px" />
+        </el-form-item>
         <el-form-item label="设备编码" prop="equipmentCode">
           <el-input v-model.trim="form.equipmentCode" placeholder="请输入设备编码" />
         </el-form-item>
@@ -22,31 +27,15 @@
             </template>
           </el-input>
         </el-form-item>
-        <el-form-item label="设备状态" prop="equipmentStatusCode"  >
-          <el-select
-            v-model="form.equipmentStatusCode"
-            placeholder="请选择设备状态"   
-          >
-            <el-option
-              v-for="dict in equipment_status"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
-            ></el-option>
+        <el-form-item label="设备状态" prop="equipmentStatusCode">
+          <el-select v-model="form.equipmentStatusCode" placeholder="请选择设备状态">
+            <el-option v-for="dict in equipment_status" :key="dict.value" :label="dict.label"
+              :value="dict.value"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="虚拟设备" prop="isVirtualEquipment"  >
-          <el-select
-            v-model="form.isVirtualEquipment"
-            placeholder="请选择是否是虚拟设备"  
-            :disabled="!editStatus" 
-          >
-            <el-option
-              v-for="dict in yes_no"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
-            ></el-option>
+        <el-form-item label="虚拟设备" prop="isVirtualEquipment">
+          <el-select v-model="form.isVirtualEquipment" placeholder="请选择是否是虚拟设备" :disabled="!editStatus">
+            <el-option v-for="dict in yes_no" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="备注" prop="remark">
@@ -59,17 +48,19 @@
       <el-button icon="Close" @click="handleCancel">取 消</el-button>
     </template>
 
-    <select-dept-dialog ref="selectDeptRef" @handleSelectDept="handleSelectDept" @handleSelectBelongingDept="handleSelectBelongingDept" />
+    <select-dept-dialog ref="selectDeptRef" @handleSelectDept="handleSelectDept"
+      @handleSelectBelongingDept="handleSelectBelongingDept" />
   </el-dialog>
 </template>
 <script setup>
-import { getDetails, saveDetails } from '@/api/business/equipment'
+import { getDetails, saveDetails ,listCategories} from '@/api/business/equipment'
 import selectDeptDialog from '@/components/Dialog/Department'
 const emit = defineEmits(['handleSaveSuccess'])
 const { proxy } = getCurrentInstance()
 /** 字典数组区 */
 const { equipment_status } = proxy.useDict("equipment_status");
 const { yes_no } = proxy.useDict("yes_no");
+const parentCategories = ref([])
 /** 表单抽屉 页变量 */
 const loading = ref(false)
 const visible = ref(false)
@@ -78,6 +69,7 @@ const equipmentCodeIds = ref([])
 const data = reactive({
   form: {},
   rules: {
+    equipmentCategoryId:[{ required: true, message: '设备编码不能为空', trigger: 'blur' }],
     equipmentCode: [{ required: true, message: '设备编码不能为空', trigger: 'blur' }],
     equipmentName: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
     usageDeptAlias: [{ required: true, message: '使用部门不能为空', trigger: 'change' }],
@@ -97,10 +89,20 @@ const open = (data) => {
     editStatus.value = false
     getDetails(data.id).then((res) => {
       form.value = res.data
+
     })
   }
+  getCategoryList()
 }
 
+function getCategoryList() {
+  listCategories({}).then(res => {
+    if (res.code == 200) {
+      console.log(res)
+      parentCategories.value = res.data
+    }
+  })
+}
 /** 取消按钮 */
 const handleCancel = () => {
   visible.value = false
@@ -119,7 +121,7 @@ const reset = () => {
     equipmentStatusId: 0,
     equipmentStatusCode: 'NA',
     remark: '',
-    isVirtualEquipment:'0'
+    isVirtualEquipment: '0'
   }
   proxy.resetForm('formDetailRef')
 }

+ 46 - 300
src/views/business/equipment/index.vue

@@ -1,126 +1,29 @@
 <template>
   <div class="page-container row-container">
-    <!-- 左侧区域 -->
-    <section class="list-part-container">
-      <!-- 搜索区域 -->
-      <el-form class="list-search-container" :inline="true">
-        <el-form-item class="section-title" label="设备类别" />
-        <el-form-item label="设备类别名称:">
-          <el-input
-            placeholder="请输入设备类别名称"
-            v-model.trim="name"
-            clearable
-            style="width: 180px"
-            @keydown.enter.prevent
-          />
-        </el-form-item>
-        <el-form-item>
-          <el-button
-            type="primary"
-            icon="Plus"
-            v-hasPermi="['business:equipment:add']"
-            @click="handleShowEquipmentCategoryDialog(null)"
-          >
-            新增
-          </el-button>
-        </el-form-item>
-      </el-form>
-      <!-- 设备类别列表区域 -->
-      <div class="el-table-container">
-        <div class="el-table-inner-container">
-          <el-tree
-            ref="categoryTable"
-            v-loading="equipmentCategoryLoading"
-            :data="equipmentCategoryList"
-            :props="{ label: 'name', children: 'children' }"
-            :expand-on-click-node="false"
-            :filter-node-method="filterNode"
-            default-expand-all
-            node-key="id"
-            highlight-current
-            style="max-height: 100%; overflow-y: auto; margin-bottom: 20px"
-            @node-click="handleCurrentCategoryChange"
-          >
-            <template #default="{ node, data }">
-              <div
-                style="
-                  display: flex;
-                  width: 100%;
-                  justify-content: space-between;
-                "
-              >
-                <span>{{ node.label }}</span>
-                <span>
-                  <el-button
-                    link
-                    type="warning"
-                    icon="Edit"
-                    @click="handleShowEquipmentCategoryDialog(data)"
-                    v-hasPermi="['business:equipment:edit']"
-                    >编辑
-                  </el-button>
-                  <el-button
-                    link
-                    type="danger"
-                    icon="Delete"
-                    @click="handleDeleteCategory(data)"
-                    v-hasPermi="['business:equipment:remove']"
-                    >删除
-                  </el-button>
-                </span>
-              </div>
-            </template>
-          </el-tree>
-        </div>
-      </div>
-      <!-- <pagination
-        v-show="equipmentCategoryTotal > 0"
-        :total="equipmentCategoryTotal"
-        :pager-count="4"
-        v-model:page="queryEquipmentCategoryParams.pageNum"
-        v-model:limit="queryEquipmentCategoryParams.pageSize"
-        @pagination="getCategoryList"
-      /> -->
-    </section>
-
-    <!-- 右侧区域 -->
+    
     <section class="list-part-container" style="flex: 2">
       <!-- 搜索区域 -->
-      <el-form
-        class="list-search-container"
-        :model="queryParams"
-        ref="queryRef"
-        :inline="true"
-      >
+      <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
         <el-form-item class="section-title" label="设备档案管理" />
+        <el-form-item label="设备类别:" prop="equipmentCategoryId">
+          <el-select-v2 v-model="queryParams.equipmentCategoryId" clearable filterable :options="parentCategories"
+            placeholder="设备类别" @change="handleRefreshEquipment" />
+        </el-form-item>
+        <el-form-item label="设备名称:">
+          <el-input placeholder="请输入设备名称" v-model.trim="queryParams.categoryName" @keydown.enter.prevent
+            clearable style="width: 180px" />
+        </el-form-item>
         <el-form-item label="设备编码:">
-          <el-input
-            placeholder="请输入设备编码"
-            v-model.trim="queryParams.equipmentCode"
-            @keydown.enter.prevent
-            :disabled="equipmentCategoryList.length == 0"
-            clearable
-            style="width: 180px"
-          />
+          <el-input placeholder="请输入设备编码" v-model.trim="queryParams.equipmentCode" @keydown.enter.prevent
+            clearable style="width: 180px" />
         </el-form-item>
         <el-form-item>
-          <el-button
-            type="info"
-            icon="Search"
-            :disabled="equipmentCategoryList.length == 0"
-            @click="handleRefreshEquipment"
-            >搜索</el-button
-          >
+          <el-button type="info" icon="Search" 
+            @click="handleRefreshEquipment">搜索</el-button>
         </el-form-item>
         <el-form-item>
-          <el-button
-            type="primary"
-            icon="Plus"
-            :disabled="equipmentCategoryList.length == 0"
-            @click="handleShowEquipmentDetailDialog(null)"
-            v-hasPermi="['business:equipment:add']"
-            >新增</el-button
-          >
+          <el-button type="primary" icon="Plus" 
+            @click="handleShowEquipmentDetailDialog(null)" v-hasPermi="['business:equipment:add']">新增</el-button>
         </el-form-item>
         <!-- <el-form-item>
           <el-button
@@ -135,89 +38,34 @@
       <!-- 列表区域 -->
       <div class="el-table-container">
         <div class="el-table-inner-container">
-          <el-table
-            ref="equipmentTable"
-            v-loading="equipmentLoading"
-            row-key="id"
-            @selection-change="handleSelectionChange"
-            :data="equipmentDetailList"
-            height="100%"
-          >
-            <el-table-column
-              type="selection"
-              width="40"
-              align="center"
-              :reserve-selection="true"
-            />
-            <el-table-column
-              label="行号"
-              type="index"
-              width="50"
-              align="center"
-            />
-            <el-table-column
-              label="设备编码"
-              prop="equipmentCode"
-              width="120"
-              align="center"
-            />
-            <el-table-column
-              label="设备名称"
-              prop="equipmentName"
-              width="250"
-              align="center"
-            />
-            <el-table-column
-              label="归属部门"
-              prop="belongingDeptAlias"
-              width="100"
-              align="center"
-            />
-            <el-table-column
-              label="使用部门"
-              prop="usageDeptAlias"
-              width="100"
-              align="center"
-            />
-            <el-table-column
-              label="设备状态"
-                prop="equipmentStatusCode"
-                width="100"
-                align="center"
-            >
+          <el-table ref="equipmentTable" v-loading="equipmentLoading" row-key="id"
+            @selection-change="handleSelectionChange" :data="equipmentDetailList" height="100%">
+            <el-table-column type="selection" width="40" align="center" :reserve-selection="true" />
+            <el-table-column label="行号" type="index" width="50" align="center" />
+            <el-table-column label="设备编码" prop="equipmentCode" width="120" align="center" />
+            <el-table-column label="设备类别" prop="categoryName" width="120" align="center" />
+            <el-table-column label="设备名称" prop="equipmentName" width="250" align="center" />
+            <el-table-column label="归属部门" prop="belongingDeptAlias" width="100" align="center" />
+            <el-table-column label="使用部门" prop="usageDeptAlias" width="100" align="center" />
+            <el-table-column label="设备状态" prop="equipmentStatusCode" width="100" align="center">
               <template #default="scope">
-                <dict-tag :options="equipment_status" :value="scope.row.equipmentStatusCode"/>
+                <dict-tag :options="equipment_status" :value="scope.row.equipmentStatusCode" />
               </template>
             </el-table-column>
-            <el-table-column
-              label="虚拟设备"
-                prop="isVirtualEquipment"
-                width="100"
-                align="center"
-            >
+            <el-table-column label="虚拟设备" prop="isVirtualEquipment" width="100" align="center">
               <template #default="scope">
-                <dict-tag :options="yes_no" :value="scope.row.isVirtualEquipment"/>
+                <dict-tag :options="yes_no" :value="scope.row.isVirtualEquipment" />
               </template>
             </el-table-column>
             <el-table-column label="备注" prop="remark" align="center" />
             <el-table-column label="操作" width="150" align="center">
               <template #default="scope">
-                <el-button
-                  v-hasPermi="['business:equipmentDetail:edit']"
-                  link
-                  type="warning"
-                  icon="Edit"
-                  @click="handleShowEquipmentDetailDialog(scope.row.id)"
-                >
+                <el-button v-hasPermi="['business:equipmentDetail:edit']" link type="warning" icon="Edit"
+                  @click="handleShowEquipmentDetailDialog(scope.row.id)">
                   编辑
                 </el-button>
-                <el-button
-                  v-hasPermi="['business:equipmentDetail:remove']"
-                  link
-                  type="danger"
-                  icon="Delete"
-                  @click="handleDeleteEquipmentDetail(scope.row.id)"
-                >
+                <el-button v-hasPermi="['business:equipmentDetail:remove']" link type="danger" icon="Delete"
+                  @click="handleDeleteEquipmentDetail(scope.row.id)">
                   删除
                 </el-button>
               </template>
@@ -225,33 +73,18 @@
           </el-table>
         </div>
       </div>
-      <pagination
-        v-show="equipmentTotal > 0"
-        :total="equipmentTotal"
-        v-model:page="queryParams.pageNum"
-        v-model:limit="queryParams.pageSize"
-        @pagination="getEquipmentList"
-      />
+      <pagination v-show="equipmentTotal > 0" :total="equipmentTotal" v-model:page="queryParams.pageNum"
+        v-model:limit="queryParams.pageSize" @pagination="getEquipmentList" />
     </section>
-    <!-- 设备类别表单 -->
-    <equipment-category-form
-      ref="categoryRef"
-      @handleSaveSuccess="handleRefreshCategory"
-    />
     <!-- 设备档案管理表单 -->
-    <equipment-detail-form
-      ref="detailRef"
-      @handleSaveSuccess="handleRefreshDetail"
-    />
+    <equipment-detail-form ref="detailRef" @handleSaveSuccess="handleRefreshDetail" />
   </div>
 </template>
 
 <script setup name="Equipment">
-import equipmentCategoryForm from "./formCategory";
 import equipmentDetailForm from "./formDetail";
 import {
-  listCategory,
-  delCategory,
+  listCategories,
   detailList,
   delDetails,
 } from "@/api/business/equipment";
@@ -260,20 +93,13 @@ const webHost = import.meta.env.VITE_APP_PRODUCTION_API;
 /**字典数组 */
 const { equipment_status } = proxy.useDict("equipment_status");
 const { yes_no } = proxy.useDict("yes_no");
-/** 设备类别*/
-const categoryTable = ref(null);
-const currentCategory = ref({});
-const equipmentCategoryList = ref([]);
-const equipmentCategoryTotal = ref(0);
-const name = ref("");
 /** 设备档案管理 */
 const selections = ref([]);
 const equipmentTable = ref(null);
 const equipmentTotal = ref(0);
 const equipmentDetailList = ref([]);
 const equipmentLoading = ref(false);
-const equipmentCategoryLoading = ref(true);
-
+const parentCategories = ref([])
 /** 设备类别 查询对象 */
 const queryEquipmentCategoryParams = ref({
   name: "",
@@ -289,32 +115,10 @@ const queryParams = ref({
 
 /****************************************************  生命周期函数区  ****************************************************/
 onMounted(() => {
-  getCategoryList();
+  getEquipmentList();
 });
 /****************************************************  方法区  ****************************************************/
 
-/****************************** 设备类别 事件处理区 ******************************/
-/** 获取设备分类列表 */
-const getCategoryList = () => {
-  queryParams.value.categoryId = null;
-  equipmentCategoryLoading.value = true;
-  listCategory(queryEquipmentCategoryParams.value).then((response) => {
-    equipmentCategoryList.value = response.rows;
-    equipmentCategoryTotal.value = response.total;
-    console.log(equipmentCategoryList.value.length);
-    if (equipmentCategoryList.value.length > 0) {
-      currentCategory.value = equipmentCategoryList.value[0];
-      nextTick(() => {
-        proxy.$refs.categoryTable.setCurrentKey(currentCategory.value.id);
-        handleCurrentCategoryChange(currentCategory.value);
-      });
-    } else {
-      currentCategory.value = {};
-      equipmentDetailList.value = [];
-    }
-    equipmentCategoryLoading.value = false;
-  });
-};
 /** 打开设备档案详情表单 */
 const handleShowEquipmentDetailDialog = (id) => {
   if (id) {
@@ -327,7 +131,6 @@ const handleShowEquipmentDetailDialog = (id) => {
   }
 
   let data = {
-    equipmentCategoryId: currentCategory.value.id,
     id: id,
     equipmentCode: equipmentCodeIds,
   };
@@ -342,70 +145,11 @@ const handleDeleteEquipmentDetail = (id) => {
       delDetails(id).then(res => {
         if (res.code === 200) {
           proxy.$modal.msgSuccess("操作成功!");
-          handleCurrentCategoryChange(currentCategory.value);
+          getEquipmentList()
         }
       });
     })
-    .catch(() => {});
-};
-/** 刷新设备分类列表 */
-const handleRefreshCategory = () => {
-  getCategoryList();
-};
-//设备类别搜索,前端过滤
-watch(name, (val) => {
-  equipmentDetailList.value = [];
-  equipmentTotal.value = 0;
-  proxy.$refs["categoryTable"].filter(val);
-});
-const filterNode = (value, data) => {
-  if (!value) {
-    return true;
-  }
-  queryParams.value.equipmentCode = "";
-  return data.name.indexOf(value) !== -1;
-};
-//删除设备类别
-const handleDeleteCategory = (data) => {
-  var showErrorMessage = false;
-  proxy.$modal
-    .confirm("确定删除数据项?")
-    .then(() => {
-      if (data.children) {
-        showErrorMessage = true;
-        return Promise.reject(new Error("HasChildrenError"));
-      }
-      return delCategory(data.id);
-    })
-    .then(() => {
-      if (!showErrorMessage) {
-        handleRefreshCategory();
-        proxy.$modal.msgSuccess("操作成功!");
-      }
-    })
-    .catch(() => {})
-    .finally(() => {
-      if (showErrorMessage) {
-        proxy.$modal.msgError("该设备类别下有子类别,不能删除!");
-      }
-    });
-};
-
-/** 设备类别表格 current-change 事件 */
-function handleCurrentCategoryChange(row) {
-  if (row) {
-    currentCategory.value = row;
-    queryParams.value.equipmentCategoryId = row.id;
-    getEquipmentList();
-  }
-}
-
-/** 打开设备分类表单 */
-const handleShowEquipmentCategoryDialog = (data) => {
-  if (data) {
-    proxy.$refs.categoryRef.open(data.id);
-  }
-  proxy.$refs.categoryRef.open();
+    .catch(() => { });
 };
 
 /****************************** 设备档案 事件处理区 ******************************/
@@ -417,14 +161,14 @@ function handleRefreshEquipment() {
 /** 获取设备档案列表 */
 const getEquipmentList = () => {
   equipmentLoading.value = true;
-  console.log(queryParams.value);
-  if (queryParams.value.equipmentCategoryId) {
     detailList(queryParams.value).then((res) => {
       equipmentDetailList.value = res.rows;
       equipmentLoading.value = false;
       equipmentTotal.value = res.total;
     });
-  }
+    listCategories({}).then(response=>{
+      parentCategories.value = response.data
+    })
 };
 //刷新设备档案管理
 function handleRefreshDetail() {
@@ -456,12 +200,14 @@ function handleDownloadQrCode() {
   display: inline-block;
   width: 100%;
 }
+
 :deep(.el-tree-node__content) {
   height: 40px;
   border-bottom: 1px solid #ebeef5;
   padding: 8px 0;
   line-height: 23px;
 }
+
 .move-handle {
   cursor: move;
   background-color: #eee;

+ 238 - 0
src/views/business/report/index.vue

@@ -0,0 +1,238 @@
+<template>
+    <div class="page-container row-container">
+        <!-- 左侧区域 -->
+        <section class="list-part-container" style="flex: 3">
+            <!-- 搜索区 -->
+            <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true"
+                style="margin-right: 0px">
+                <el-form-item class="section-title" label="报工日报" />
+                <el-form-item label="生产计划单号:">
+                    <el-input placeholder="请输入批次号" v-model.trim="queryParams.lotCode" @keydown.enter.prevent clearable
+                        style="width: 200px" />
+                </el-form-item>
+                <el-form-item label="产品描述:">
+                    <el-input placeholder="请输入产品描述" v-model.trim="queryParams.productDescription" @keydown.enter.prevent
+                        clearable style="width: 130px" />
+                </el-form-item>
+                <el-form-item label="员工姓名:">
+                    <el-input placeholder="请输入员工姓名" v-model.trim="queryParams.nickName" @keydown.enter.prevent clearable
+                        style="width: 130px" />
+                </el-form-item>
+                <el-form-item label="箱号:">
+                    <el-input placeholder="请输入箱号" v-model.trim="queryParams.originalCarrier" @keydown.enter.prevent
+                        clearable style="width: 130px" />
+                </el-form-item>
+                <el-form-item class="section-title" label="请选择当前工段:">
+                    <el-select-v2 v-model="queryParams.deptId" :options="deptList" placeholder="请选择工段" style="width: 140px"
+                        @change="handleDeptChange" />
+                </el-form-item>
+                <el-form-item label="时间:">
+                    <el-date-picker v-model="queryParams.startTime" type="date" value-format="YYYY-MM-DD" :editable="false"
+                        :clearable="false" placeholder="请选择开始时间" style="width: 130px" @change="handleDateChange" />
+                    <span>To</span>
+                    <el-date-picker v-model="queryParams.endTime" type="date" value-format="YYYY-MM-DD" :editable="false"
+                        :clearable="false" placeholder="请选择结束时间" style="width: 130px" @change="handleDateChange" />
+                </el-form-item>
+                <el-form-item style="margin-left: 0">
+                    <el-button type="info" icon="Search" @click="handleQuery">搜索
+                    </el-button>
+                    <el-button type="success"  icon="Download" @click="handleExport">导出</el-button>
+                </el-form-item>
+            </el-form>
+            <div class="el-table-container">
+                <div class="el-table-inner-container">
+                    <el-table ref="dayworkTable" :data="dayworkItemList" v-loading="dayworkLoading" highlight-current-row
+                        height="100%">
+                        <el-table-column label="操作者" prop="nickName" width="160" align="center" />
+                        <el-table-column label="批次号" prop="lotCode" width="160" align="center" />
+                        <el-table-column label="产品描述" prop="productDescription" align="center" />
+                        <el-table-column label="图纸版本" prop="technologyVersion" width="60" align="center" />
+                        <el-table-column label="工序名称" prop="processAlias" width="160" align="center" />
+                        <el-table-column label="投产量" prop="prodNum" width="60" align="center" />
+                        <el-table-column label="合格数" prop="qualifiedNum" width="60" align="center" />
+                        <el-table-column label="废品数" prop="rejectNum" width="60" align="center" />
+                        <el-table-column label="开始时间" prop="startTime" width="160" align="center" />
+                        <el-table-column label="结束时间" prop="endTime" width="160" align="center" />
+                        <el-table-column label="总工时" prop="workingHours" width="160" align="center" />
+                        <el-table-column label="生产状态" prop="status" width="100" align="center">
+                            <template #default="scope">
+                                <dict-tag :options="daywork_status" :value="scope.row.status" />
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="箱号" prop="originalCarrier" align="center">
+                            <template v-slot:header>
+                                箱号
+                                <el-popover placement="top-start" effect="dark" trigger="hover"
+                                    content="显示批次最新箱号,会根据实际情况变动">
+                                    <template #reference>
+                                        <el-icon>
+                                            <QuestionFilled />
+                                        </el-icon>
+                                    </template>
+                                </el-popover>
+                            </template>
+                        </el-table-column>
+                    </el-table>
+                </div>
+            </div>
+            <!-- 分页 -->
+            <pagination v-show="itemTotal > 0" :total="itemTotal" v-model:page="queryParams.pageNum"
+                v-model:limit="queryParams.pageSize" @pagination="getDayworkItems" />
+        </section>
+        <!-- 右侧区域 -->
+
+
+    </div>
+</template>
+  
+<script setup>
+import {
+    listReportItem,
+    delDayworkItem
+} from "@/api/business/daywork.js";
+import { listDeptProcess } from "@/api/business/deptProcess";
+import { getDept } from "@/api/business/planDetailSubDetail.js";
+import router from "@/router";
+
+const { proxy } = getCurrentInstance();
+
+/** 字典 */
+const { daywork_status } = proxy.useDict("daywork_status");
+
+/** 生产批次 */
+const dayworkTable = ref(null);
+const currentDaywork = ref({});
+const dayworkLoading = ref(false);
+const total = ref(0);
+/**工段 */
+const deptList = ref([]);
+const loading = ref(false);
+/** 报工信息 */
+const dayworkItemList = ref([]);
+const dayworkItemLoading = ref(false);
+const itemTotal = ref(0);
+const lastStatus = ref(null)
+const latestProcessId = ref(null);
+const latestDeptId = ref(null)
+const deptProcessList = ref([]);
+/**工序 */
+const processList = ref([]);
+
+const queryParams = ref({
+    dayworkId: "0",
+    isAmend: 0,
+    isWasteRecycling: 0,
+    pageNum: 1,
+    pageSize: 10,
+    technologicalProcessDetailId: null,
+});
+
+/***********************  工段相关事件  ****************************/
+function getList() {
+    loading.value = true;
+    getDept().then((response) => {
+        deptList.value = response.data;
+        loading.value = false;
+          if (deptList.value.length > 0) {
+        queryParams.value.deptId = deptList.value[0].value;
+        // queryParams.value.deptId = '14'
+        console.log(22222)
+        getDayworkItems();
+          } else {
+            dayworkItemList.value = [];
+          }
+    });
+}
+
+//切换工段
+function handleDeptChange() {
+    getDayworkItems();
+}
+
+
+
+
+
+
+/***********************  报工信息相关事件  ****************************/
+
+function handleDateChange() {
+    console.log(queryParams.value.startTime);
+    console.log(queryParams.value.endTime);
+}
+
+
+/**切换工序 */
+function handleProcessChange() {
+    getDayworkItems();
+}
+
+/** 报工详情列表 */
+function getDayworkItems() {
+    console.log(111111)
+    dayworkItemLoading.value = true;
+    //查询该工段在工段资源分配时绑定的工序,传一个flag,如果flag有值则后端查询不分页
+    listDeptProcess({ deptId: queryParams.value.deptId, flag: 1 }).then(
+        (res) => {
+            deptProcessList.value = res.rows;
+        }
+    );
+    listReportItem(queryParams.value).then((res) => {
+        console.log(res)
+        for (let i = 0; i < res.rows.length; i++) {
+            //如果时首序,投产数是单批数
+            if (res.rows[i].prodNum == 0) {
+                if (currentDaywork.value.isLast == 1) {
+                    res.rows[i].prodNum = currentDaywork.value.lastLotQuantity;
+                } else {
+                    res.rows[i].prodNum = currentDaywork.value.oneLotQuantity;
+                }
+            }
+            //拿到最新一条报工信息的工序id,只能编辑当前序
+            // if (res.rows[i] == res.rows[res.rows.length - 1]) {
+            //   latestProcessId.value = res.rows[i].processId;
+            // }
+        }
+        if (res.others != null && res.others.latestProcessId != null) {
+            latestProcessId.value = res.others.latestProcessId
+        }
+        if (res.others != null && res.others.lastItem != null) {
+            latestDeptId.value = res.others.lastItem.deptId
+            lastStatus.value = res.others.lastItem.status
+        }
+        for (var i = 0; i < res.rows.length; i++) {
+            let timeStamp = res.rows[i].workingHours;
+            let seconds = Math.floor((timeStamp / 1000) % 60);
+            let minutes = Math.floor((timeStamp / (1000 * 60)) % 60);
+            let hours = Math.floor(timeStamp / (1000 * 60 * 60));
+            let time = `${hours}小时${minutes}分钟${seconds}秒`;
+            res.rows[i].workingHours = time;
+            res.rows[i].deptProcessStatus = false;
+
+        }
+        dayworkItemList.value = res.rows;
+        itemTotal.value = res.total;
+        dayworkItemLoading.value = false;
+    });
+}
+/** 导出按钮操作 */
+function handleExport() {
+    proxy.download('/ezhizao-dms-production/business/productionDaywork/download', {
+        ...queryParams.value
+    }, `报工日报${new Date().getTime()}.xlsx`)
+}
+/** 搜索按钮操作 */
+function handleQuery() {
+    getDayworkItems();
+}
+
+onMounted(() => {
+    getList();
+});
+</script>
+<style scoped>
+.el-form--inline .el-form-item {
+    margin-right: 20px;
+}
+</style>
+  

+ 136 - 0
src/views/business/reportPlan/index.vue

@@ -0,0 +1,136 @@
+<template>
+    <div class="page-container column-container">
+        <section class="list-part-container column-container" style="flex: 1">
+            <!-- 搜索区 -->
+            <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
+                <el-form-item class="section-title" label="生产计划" />
+                <el-form-item label="生产计划单号:">
+                    <el-input placeholder="请输入生产计划单号" v-model.trim="queryParams.productionPlanNo"
+                        @keyup.enter="handleQueryProductionPlanDetail" @keydown.enter.prevent clearable
+                        style="width: 200px" />
+                </el-form-item>
+                <el-form-item label="产品描述:">
+                    <el-input placeholder="请输入产品描述" v-model.trim="queryParams.keywords"
+                        @keyup.enter="handleQueryProductionPlanDetail" @keydown.enter.prevent clearable
+                        style="width: 200px" />
+                </el-form-item>
+                <el-form-item class="section-title" label="请选择当前工段:">
+                    <el-select-v2 v-model="queryParams.deptId" filterable :options="deptList" placeholder="请选择工段"
+                        style="width: 100%" @change="handleDeptChange" />
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="info" icon="Search" @click="handleQueryProductionPlanDetail">
+                        搜索
+                    </el-button>
+                </el-form-item>
+
+            </el-form>
+            <div class="el-table-container">
+                <div class="el-table-inner-container">
+                    <el-table ref="planDetailTable" :data="detailPlanList" v-loading="detailLoading" highlight-current-row
+                        height="100%">
+                        <el-table-column label="客户简称" prop="companyAlias" width="120" align="center" />
+                        <el-table-column label="生产计划单号" prop="productionPlanNo" width="110" align="center" />
+                        <el-table-column label="序号" width="60" prop="lineNumber" align="center" />
+                        <el-table-column label="产品描述" prop="productDescription" align="center" />
+                        <el-table-column label="图纸版本" prop="technologyVersion" width="70" align="center" />
+                        <el-table-column label="在产批数" prop="inProduction" width="70" align="center" />
+                        <el-table-column label="已完成批数" prop="afterProduction" width="70" align="center" />
+                        <el-table-column label="未投产批数" prop="technologyVersion" width="70" align="center">
+                            <template #default="scope">
+                                {{ scope.row.totalLotNumber - scope.row.inProduction - scope.row.afterProduction }}
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="工段" prop="currentDepartment" width="70" align="center" />
+                    </el-table>
+                </div>
+            </div>
+        </section>
+        <!-- 分页 -->
+        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+            v-model:limit="queryParams.pageSize" @pagination="getProductionPlanDetail" />
+
+
+    </div>
+</template>
+<script setup name="ProductionBatch">
+import { ref } from "vue";
+import { reportListPlanDetail } from "@/api/business/productionPlanDetail.js";
+import { getDept } from "@/api/business/planDetailSubDetail.js";
+// import productionDialog from "./DialogProduction";
+const { proxy } = getCurrentInstance();
+/** 生产计划 */
+const currentPlanDetail = ref({});
+const detailPlanList = ref([]);
+const detailLoading = ref(false);
+const total = ref(0);
+/** 工段 */
+const loading = ref(false);
+const deptList = ref([]);
+/** 查询对象 */
+const queryParams = ref({
+    deptId: "",
+    keywords: "",
+    pageNum: 1,
+    pageSize: 10,
+});
+
+/***********************  方法区  ****************************/
+/***********************  工段  ****************************/
+/**
+查询工段
+ *
+ */
+function getList() {
+    loading.value = true;
+    getDept().then((response) => {
+        deptList.value = response.data;
+        // queryParams.value.deptId = '14'
+        if (deptList.value.length > 0) {
+            queryParams.value.deptId = deptList.value[0].value;
+
+            getProductionPlanDetail();
+        }
+    });
+    loading.value = false;
+}
+/**工段下拉框change事件 */
+function handleDeptChange() {
+    handlePlanDetailCurrentChange(currentPlanDetail.value);
+}
+/***********************  生产计划  ****************************/
+
+
+/**查询计划明细 */
+function getProductionPlanDetail() {
+    detailLoading.value = true;
+    console.log(queryParams.value)
+    reportListPlanDetail(queryParams.value).then((res) => {
+        detailPlanList.value = res.rows;
+        total.value = res.total;
+        detailLoading.value = false;
+
+    });
+}
+/** 生产计划搜索按钮操作 */
+function handleQueryProductionPlanDetail() {
+    queryParams.value.pageNum = 1;
+    getProductionPlanDetail();
+}
+//查询生产计划单的领料信息
+function handleCheckMarterialInfo(row) {
+    proxy.$refs.checkMaterialRef.open(row);
+}
+
+
+onMounted(() => {
+    getList();
+});
+</script>
+<style scoped>
+.list-search-container-child .el-form-item {
+    /* 修改样式 */
+    margin-right: 10px;
+}
+</style>
+