ezhizao_zx 6 сар өмнө
parent
commit
2526f544c4

+ 10 - 3
src/store/modules/productionPlanDetail.js

@@ -1,11 +1,18 @@
 
 const productionPlanDetailStore = defineStore('productionPlanDetail', {
   state: () => ({
-      productionPlanNo:null
+    productionPlanNo: null,
+    productionPlanDetailQueryParams: null
   }),
   actions: {
-    setProductionPlanDetailQueryParams(value) { 
-      this.productionPlanNo = value;
+    setProductionPlanDetailQueryParams(value) {
+      this.productionPlanDetailQueryParams = value;
+    },
+    setProductionPlanNo(value) {
+      this.productionPlanNo = value
+      if (this.productionPlanDetailQueryParams != null) {
+        this.productionPlanDetailQueryParams.productionPlanNo = value
+      }
     }
   }
 })

+ 31 - 3
src/store/modules/query.js

@@ -1,11 +1,39 @@
 
 const queryStore = defineStore('query', {
   state: () => ({
-    dayworkSelectParams: null
+    searchPositionParams: null,
+    reviseBathParams: null,
+    reportPlanParams: null,
+    reportParams: null,
+    rejectReportParams: null,
+    sortRejectParams: null,
+    rejectCategoryParams: null,
+    rejectDetailParams: null
   }),
   actions: {
-    setDayworkSelectParams(value) {
-      this.dayworkSelectParams = value;
+    setSearchPositionParams(value) {
+      this.searchPositionParams = value;
+    },
+    setReviseBathParams(value) {
+      this.reviseBathParams = value
+    },
+    setReportPlanParams(value) {
+      this.reportPlanParams = value
+    },
+    setReportParams(value) {
+      this.reportParams = value
+    },
+    setRejectReportParams(value) {
+      this.rejectReportParams = value
+    },
+    setSortRejectParams(value) {
+      this.sortRejectParams = value
+    },
+    setRejectCategoryParams(value) {
+      this.rejectCategoryParams = value
+    },
+    setRejectDetailParams(value) {
+      this.rejectDetailParams = value
     }
   }
 })

+ 10 - 1
src/views/business/dayworkSelect/index.vue

@@ -229,7 +229,7 @@ function getList() {
   console.log(productionPlanDetailStore().productionPlanNo)
   if (productionPlanDetailStore().productionPlanNo != null) {
     queryDayworkParams.value.productionPlanNo = productionPlanDetailStore().productionPlanNo
-    productionPlanDetailStore().setProductionPlanDetailQueryParams(null)
+    productionPlanDetailStore().setProductionPlanNo(null)
   }
   getPremission();
   getDayworks();
@@ -245,6 +245,12 @@ function handleDeptChange() {
 /** 查询计划明细 */
 function getDayworks() {
   dayworkLoading.value = true;
+  const productionPlanDetailQueryParams = productionPlanDetailStore().productionPlanDetailQueryParams;
+
+  if (productionPlanDetailQueryParams != null) {
+    queryDayworkParams.value = productionPlanDetailQueryParams;
+    dateRange.value = productionPlanDetailQueryParams.queryStartTime != null ? [productionPlanDetailQueryParams.queryStartTime, productionPlanDetailQueryParams.queryEndTime] : null
+  }
   lotList(queryDayworkParams.value).then((res) => {
     dayworkList.value = res.rows;
     for (var i = 0; i < dayworkList.value.length; i++) {
@@ -534,6 +540,9 @@ function getProcess() {
 
 /** 搜索按钮操作 */
 function handleQuery() {
+  const dayworkQueryParams = JSON.parse(JSON.stringify(queryDayworkParams.value));
+  // console.log("lotQueryParams", lotQueryParams);
+  productionPlanDetailStore().setProductionPlanDetailQueryParams(dayworkQueryParams);
   getDayworks();
 }
 

+ 79 - 126
src/views/business/reject/index.vue

@@ -3,44 +3,22 @@
     <!-- 左侧区域 -->
     <section class="list-part-container" style="flex: 1">
       <!-- 搜索区域 -->
-      <el-form
-        class="list-search-container"
-        ref="queryRef"
-        :inline="true"
-        style="display: flex"
-      >
+      <el-form class="list-search-container" ref="queryRef" :inline="true" style="display: flex">
         <el-form-item class="section-title" label="载具类别" />
         <el-form-item label="类别名称:">
-          <el-input
-            placeholder="请输入类别名称"
-            clearable
-            style="width: 150px"
-            v-model.trim="name"
-            @keydown.enter.prevent
-          />
+          <el-input placeholder="请输入类别名称" clearable style="width: 150px" v-model.trim="name" @keydown.enter.prevent />
         </el-form-item>
       </el-form>
       <!-- 列表区 -->
       <div class="el-table-container">
         <div class="el-table-inner-container">
-          <el-tree
-            ref="categoryTable"
-            v-loading="categoryLoading"
-            :data="carrierCategoryList"
-            :props="{ label: 'name', children: 'children' }"
-            :expand-on-click-node="false"
-            :filter-node-method="filterNode"
-            default-expand-all
-            node-key="id"
-            highlight-current
-            @node-click="handleCurrentCategoryChange"
-          >
+          <el-tree ref="categoryTable" v-loading="categoryLoading" :data="carrierCategoryList"
+            :props="{ label: 'name', children: 'children' }" :expand-on-click-node="false"
+            :filter-node-method="filterNode" default-expand-all node-key="id" highlight-current
+            @node-click="handleCurrentCategoryChange">
             <template #default="{ node, data }">
               <span>
-                <span
-                  v-if="data.parentId == 0"
-                  style="display: inline-block; width: 20px"
-                  >{{ getNodeIndex(data) }}.
+                <span v-if="data.parentId == 0" style="display: inline-block; width: 20px">{{ getNodeIndex(data) }}.
                 </span>
                 <span>{{ node.label }}</span>
               </span>
@@ -52,120 +30,61 @@
 
     <!-- 右侧区域 -->
     <section class="list-part-container" style="flex: 3">
-      <el-form
-        class="list-search-container"
-        :model="queryCarrierRejectParams"
-        ref="queryRef"
-        :inline="true"
-      >
+      <el-form class="list-search-container" :model="queryCarrierRejectParams" ref="queryRef" :inline="true">
         <el-form-item class="section-title" label="载具操作明细" />
         <el-form-item label="载具编号:">
-          <el-input
-            placeholder="请输入载具编号"
-            :disabled="carrierCategoryList.length == 0"
-            clearable
-            style="width: 180px"
-            v-model.trim="queryCarrierRejectParams.code"
-            @keydown.enter.prevent
-            @keyup.enter="handleQueryCarrier"
-          />
+          <el-input placeholder="请输入载具编号" :disabled="carrierCategoryList.length == 0" clearable style="width: 180px"
+            v-model.trim="queryCarrierRejectParams.code" @keydown.enter.prevent @keyup.enter="handleQueryCarrier" />
         </el-form-item>
         <el-form-item label="载具状态:">
-          <el-select
-            v-model="queryCarrierRejectParams.isAbandoned"
-            clearable
-            placeholder="请选择载具状态"
-            style="width: 150px"
-          >
-            <el-option
-              v-for="dict in carrier_status"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
-            ></el-option>
+          <el-select v-model="queryCarrierRejectParams.isAbandoned" clearable placeholder="请选择载具状态"
+            style="width: 150px">
+            <el-option v-for="dict in carrier_status" :key="dict.value" :label="dict.label"
+              :value="dict.value"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-button
-            type="info"
-            icon="Search"
-            :disabled="carrierCategoryList.length == 0"
-            @click="handleQueryCarrier"
-            >搜索</el-button
-          >
+          <el-button type="info" icon="Search" :disabled="carrierCategoryList.length == 0"
+            @click="handleQueryCarrier">搜索</el-button>
         </el-form-item>
       </el-form>
 
       <!-- 列表区 -->
       <div class="el-table-container">
         <div class="el-table-inner-container">
-          <el-table
-            v-loading="carrierRejectLoading"
-            :data="carrierRejectList"
-            height="100%"
-          >
-            <el-table-column
-              type="index"
-              label="行号"
-              width="50"
-              align="center"
-            />
-            <el-table-column
-              prop="code"
-              label="载具编号"
-              width="120"
-              align="center"
-            />
-            <el-table-column
-              label="状态"
-              width="80"
-              prop="isAbandoned"
-              align="center"
-            >
+          <el-table v-loading="carrierRejectLoading" :data="carrierRejectList" height="100%">
+            <el-table-column type="index" label="行号" width="50" align="center" />
+            <el-table-column prop="code" label="载具编号" width="120" align="center" />
+            <el-table-column label="状态" width="80" prop="isAbandoned" align="center">
               <template #default="scope">
                 {{ scope.row.status }}
-                <dict-tag
-                  :options="carrier_status"
-                  :value="scope.row.isAbandoned"
-                />
+                <dict-tag :options="carrier_status" :value="scope.row.isAbandoned" />
               </template>
             </el-table-column>
-            <el-table-column
-              prop="operationDate"
-              label="操作日期"
-              width="130"
-              align="center"
-            >
+            <el-table-column prop="operationDate" label="操作日期" width="130" align="center">
               <template #default="scope">
                 {{ proxy.moment(scope.row.operationDate).format("YYYY-MM-DD") }}
               </template>
             </el-table-column>
-            <el-table-column
-              prop="abandonmentReason"
-              label="废弃原因"
-              align="center"
-            >
+            <el-table-column prop="abandonmentReason" label="废弃原因" align="center">
             </el-table-column>
           </el-table>
         </div>
       </div>
       <!-- 分页 -->
-      <pagination
-        v-show="carrierRejectTotal > 0"
-        :total="carrierRejectTotal"
-        v-model:page="queryCarrierRejectParams.pageNum"
-        v-model:limit="queryCarrierRejectParams.pageSize"
-        @pagination="getCarriersReject"
-      />
+      <pagination v-show="carrierRejectTotal > 0" :total="carrierRejectTotal"
+        v-model:page="queryCarrierRejectParams.pageNum" v-model:limit="queryCarrierRejectParams.pageSize"
+        @pagination="getCarriersReject" />
     </section>
   </div>
 </template>
-  
+
 <script setup name="Process">
 import { listCategory } from "@/api/business/carrier";
 import { listReject } from "@/api/business/reject";
 const { proxy } = getCurrentInstance();
 import carrierStore from "@/store/modules/carrier";
+import queryStore from "@/store/modules/query";
 /** 字典数组区 */
 const { carrier_status } = proxy.useDict("carrier_status");
 /** 载具类别变量 */
@@ -206,31 +125,51 @@ const getCategories = () => {
           let a = 0;
           let b = 0;
           console.log(carrierCategoryList.value)
-          for(let i = 0;i< carrierCategoryList.value.length;i++) {
-            if(carrierCategoryList.value[i].children){
-            for(let j = 0;j< carrierCategoryList.value[i].children.length;j++) {
-              let currentCategory = carrierCategoryList.value[i].children[j]
-              if(currentCategory.id.trim() == carrierStore().categoryId) {
-                console.log(i)
-                console.log(j)
-                a = i;
-                b = j
+          for (let i = 0; i < carrierCategoryList.value.length; i++) {
+            if (carrierCategoryList.value[i].children) {
+              for (let j = 0; j < carrierCategoryList.value[i].children.length; j++) {
+                let currentCategory = carrierCategoryList.value[i].children[j]
+                if (currentCategory.id.trim() == carrierStore().categoryId) {
+                  console.log(i)
+                  console.log(j)
+                  a = i;
+                  b = j
+                }
               }
             }
           }
-          }
           currentCategory.value = carrierCategoryList.value[a].children[b];
           console.log(currentCategory.value)
           queryCarrierRejectParams.value.code = carrierStore().carrierCode
           console.log(currentCategory.value)
-          proxy.$refs.categoryTable.setCurrentKey(carrierStore().categoryId) 
+          proxy.$refs.categoryTable.setCurrentKey(carrierStore().categoryId)
           carrierStore().setCategoryIdQueryParams(null)
-          carrierStore().setCarrierCodeQueryParams(null)    
-            }else{
-              console.log("22")
-              proxy.$refs.categoryTable.setCurrentKey(currentCategory.value.id);
+          carrierStore().setCarrierCodeQueryParams(null)
+        } else {
+
+          proxy.$refs.categoryTable.setCurrentKey(currentCategory.value.id);
+          if (queryStore().rejectDetailParams != null && queryStore().rejectDetailParams.categoryId != null) {
+            let a = 0;
+            let b = 0;
+            console.log(carrierCategoryList.value)
+            for (let i = 0; i < carrierCategoryList.value.length; i++) {
+              if (carrierCategoryList.value[i].children) {
+                for (let j = 0; j < carrierCategoryList.value[i].children.length; j++) {
+                  let currentCategory = carrierCategoryList.value[i].children[j]
+                  if (currentCategory.id.trim() == queryStore().rejectDetailParams.categoryId) {
+                    console.log(i)
+                    console.log(j)
+                    a = i;
+                    b = j
+                  }
+                }
+              }
             }
-        
+            currentCategory.value = carrierCategoryList.value[a].children[b];
+            proxy.$refs.categoryTable.setCurrentKey(queryStore().rejectDetailParams.categoryId)
+          }
+        }
+
         handleCurrentCategoryChange(currentCategory.value);
       });
     } else {
@@ -249,7 +188,7 @@ const handleCurrentCategoryChange = (row) => {
     }
   }
   if (currentCategory.value.id) {
-    getCarriersReject();
+    getCarriersReject()
   } else {
     carrierRejectList.value = [];
     carrierRejectTotal.value = 0;
@@ -257,6 +196,7 @@ const handleCurrentCategoryChange = (row) => {
 };
 //载具类别搜索事件
 watch(name, (val) => {
+  console.log('watch name change')
   proxy.$refs["categoryTable"].filter(val);
 });
 const filterNode = (value, data) => {
@@ -279,6 +219,15 @@ function getNodeIndex(data) {
 //获取载具废弃明细
 const getCarriersReject = () => {
   carrierRejectLoading.value = true;
+  const listQueryParams = queryStore().rejectDetailParams;
+  // console.log('get params', listQueryParams)
+  if (listQueryParams != null) {
+    queryCarrierRejectParams.value = listQueryParams;
+  } else {
+    const listQueryParams = JSON.parse(JSON.stringify(queryCarrierRejectParams.value));
+    queryStore().setRejectDetailParams(listQueryParams);
+    // console.log('set store params', listQueryParams)
+  }
   queryCarrierRejectParams.value.categoryId = currentCategory.value.id;
   listReject(queryCarrierRejectParams.value).then((res) => {
     carrierRejectLoading.value = false;
@@ -289,6 +238,9 @@ const getCarriersReject = () => {
 // 载具操作明细搜索
 const handleQueryCarrier = () => {
   queryCarrierRejectParams.value.pageNum = 1;
+  const listQueryParams = JSON.parse(JSON.stringify(queryCarrierRejectParams.value));
+  queryStore().setRejectDetailParams(listQueryParams);
+  // console.log('set store params', listQueryParams)
   getCarriersReject();
 };
 onMounted(() => {
@@ -299,6 +251,7 @@ onMounted(() => {
 :deep(.el-tree-node__label) {
   font-size: 14px !important;
 }
+
 :deep(.el-tree-node__content) {
   height: 40px;
   border-bottom: 1px solid #ebeef5;

+ 8 - 2
src/views/business/rejectReport/index.vue

@@ -41,8 +41,7 @@
                         <el-table-column label="工艺版本" prop="technologyVersion" align="center" />
                         <el-table-column label="废品数" prop="totalRejectNum" width="150" align="center">
                             <template #default="scope">
-                                <span v-if="scope.row.totalRejectNum > 0" style="color: blue; cursor: pointer;"
-                                    >
+                                <span v-if="scope.row.totalRejectNum > 0" style="color: blue; cursor: pointer;">
                                     {{ scope.row.totalRejectNum }}
                                 </span>
                             </template>
@@ -66,6 +65,7 @@ import {
 } from "@/api/business/dayworkItemReject.js";
 import { getDeptList } from "@/api/business/planDetailSubDetail.js";
 import rejectDialog from "./DialogRejectRecords"
+import queryStore from "@/store/modules/query";
 import { ref } from "vue";
 const { proxy } = getCurrentInstance();
 
@@ -120,6 +120,10 @@ function handleDeptChange() {
 
 /** 废品详情列表 */
 function getDayworkItemReject() {
+    const listQueryParams = queryStore().rejectReportParams;
+    if (listQueryParams != null) {
+        queryParams.value = listQueryParams;
+    }
     if (queryParams.value.startTime != null) {
         queryParams.value.startTime = proxy.moment(queryParams.value.startTime).format('YYYY-MM-DD 00:00:00')
     }
@@ -142,6 +146,8 @@ function handleExport() {
 }
 /** 搜索按钮操作 */
 function handleQuery() {
+    const listQueryParams = JSON.parse(JSON.stringify(queryParams.value));
+    queryStore().setRejectReportParams(listQueryParams);
     getDayworkItemReject();
 }
 //获得所有页的废品总数

+ 10 - 2
src/views/business/report/index.vue

@@ -86,13 +86,14 @@
     </div>
 </template>
 
-<script setup>
+<script setup name="Report">
 import {
     listReportItem,
     delDayworkItem
 } from "@/api/business/daywork.js";
 import { listDeptProcess } from "@/api/business/deptProcess";
 import { getDeptList } from "@/api/business/planDetailSubDetail.js";
+import queryStore from "@/store/modules/query";
 import router from "@/router";
 
 const { proxy } = getCurrentInstance();
@@ -139,7 +140,7 @@ function getList() {
         loading.value = false;
         if (isDispatch.value) {
             deptList.value.unshift({ label: "全部", value: "0" });
-        } 
+        }
         queryParams.value.deptId = deptList.value[0].value;
         getDayworkItems();
     });
@@ -190,6 +191,11 @@ function handleProcessChange() {
 
 /** 报工详情列表 */
 function getDayworkItems() {
+
+    const listQueryParams = queryStore().reportParams;
+    if (listQueryParams != null) {
+        queryParams.value = listQueryParams;
+    }
     if (queryParams.value.startTime != null) {
         // queryParams.value.startTime = queryParams.value.startTime + " 00:00:00";
         queryParams.value.startTime = proxy.moment(queryParams.value.startTime).format('YYYY-MM-DD 00:00:00')
@@ -252,6 +258,8 @@ function handleExport() {
 }
 /** 搜索按钮操作 */
 function handleQuery() {
+    const listQueryParams = JSON.parse(JSON.stringify(queryParams.value));
+    queryStore().setReportParams(listQueryParams);
     getDayworkItems();
 }
 

+ 140 - 219
src/views/business/reportPlan/index.vue

@@ -1,224 +1,145 @@
 <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%"
-            />
-          </el-form-item>
-          <el-form-item>
-            <el-button
-              type="info"
-              icon="Search"
-              @click="handleQueryProductionPlanDetail"
-            >
-              搜索
-            </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="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="totalLotNumber"
-                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="notProduction"
-                width="70"
-                align="center"
-              >
-              </el-table-column>
-              <el-table-column
-                label="当前生产工段"
-                prop="currentDepartment"
-                width="100"
-                align="center"
-              >
-              </el-table-column>
-            </el-table>
-          </div>
+  <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%" />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="info" icon="Search" @click="handleQueryProductionPlanDetail">
+            搜索
+          </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="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="totalLotNumber" 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="notProduction" width="70" align="center">
+            </el-table-column>
+            <el-table-column label="当前生产工段" prop="currentDepartment" width="100" align="center">
+            </el-table-column>
+          </el-table>
         </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 { getDeptList } from "@/api/business/planDetailSubDetail.js";
-  // import productionDialog from "./DialogProduction";
-  const { proxy } = getCurrentInstance();
-  /** 生产计划 */
-  const currentPlanDetail = ref({});
-  const detailPlanList = ref([]);
-  const detailLoading = ref(false);
-  const isDispatch = 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;
-    getDeptList().then((response) => {
-      deptList.value = response.data.rows;
-      isDispatch.value = response.data.others.isDispatch;
-      if (isDispatch.value) {
-            deptList.value.unshift({ label: "全部", value: "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;
+      </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 { getDeptList } from "@/api/business/planDetailSubDetail.js";
+import queryStore from "@/store/modules/query";
+// import productionDialog from "./DialogProduction";
+const { proxy } = getCurrentInstance();
+/** 生产计划 */
+const currentPlanDetail = ref({});
+const detailPlanList = ref([]);
+const detailLoading = ref(false);
+const isDispatch = 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;
+  getDeptList().then((response) => {
+    deptList.value = response.data.rows;
+    isDispatch.value = response.data.others.isDispatch;
+    if (isDispatch.value) {
+      deptList.value.unshift({ label: "全部", value: "0" });
+    }
+    queryParams.value.deptId = deptList.value[0].value;
     getProductionPlanDetail();
-  }
-  //查询生产计划单的领料信息
-  function handleCheckMarterialInfo(row) {
-    proxy.$refs.checkMaterialRef.open(row);
-  }
-  /** 导出按钮操作 */
-  function handleExport() {
-      proxy.download('/ezhizao-dms-production/business/productionPlanDetail/download', {
-          ...queryParams.value
-      }, `报工日报${new Date().getTime()}.xlsx`)
-  }
-  
-  onMounted(() => {
-    getList();
   });
-  </script>
-  <style scoped>
-  .list-search-container-child .el-form-item {
-    /* 修改样式 */
-    margin-right: 10px;
+  loading.value = false;
+}
+/**工段下拉框change事件 */
+function handleDeptChange() {
+  handlePlanDetailCurrentChange(currentPlanDetail.value);
+}
+/***********************  生产计划  ****************************/
+
+/**查询计划明细 */
+function getProductionPlanDetail() {
+  detailLoading.value = true;
+  console.log(queryParams.value);
+  const listQueryParams = queryStore().reportPlanParams;
+  if (listQueryParams != null) {
+    queryParams.value = listQueryParams;
   }
-  .strike-through {
-    text-decoration: line-through;
-  }
-  </style>
-    
-  
+  reportListPlanDetail(queryParams.value).then((res) => {
+    detailPlanList.value = res.rows;
+    total.value = res.total;
+    detailLoading.value = false;
+  });
+}
+/** 生产计划搜索按钮操作 */
+function handleQueryProductionPlanDetail() {
+  queryParams.value.pageNum = 1;
+  const listQueryParams = JSON.parse(JSON.stringify(queryParams.value));
+  queryStore().setReportPlanParams(listQueryParams);
+  getProductionPlanDetail();
+}
+//查询生产计划单的领料信息
+function handleCheckMarterialInfo(row) {
+  proxy.$refs.checkMaterialRef.open(row);
+}
+/** 导出按钮操作 */
+function handleExport() {
+  proxy.download('/ezhizao-dms-production/business/productionPlanDetail/download', {
+    ...queryParams.value
+  }, `报工日报${new Date().getTime()}.xlsx`)
+}
+
+onMounted(() => {
+  getList();
+});
+</script>
+<style scoped>
+.list-search-container-child .el-form-item {
+  /* 修改样式 */
+  margin-right: 10px;
+}
+
+.strike-through {
+  text-decoration: line-through;
+}
+</style>

+ 43 - 167
src/views/business/resourcePlan/index.vue

@@ -6,77 +6,35 @@
       <el-form class="list-search-container" ref="queryRef" :inline="true">
         <el-form-item class="section-title" label="资源组" />
         <el-form-item class="section-title" label="请选择当前工段:">
-          <el-select-v2
-            v-model="queryParams.deptId"
-            :options="deptList"
-            placeholder="请选择工段"
-            style="width: 100%"
-            @change="handleChangeDeptId"
-          />
+          <el-select-v2 v-model="queryParams.deptId" :options="deptList" placeholder="请选择工段" style="width: 100%"
+            @change="handleChangeDeptId" />
         </el-form-item>
         <el-form-item label="资源组名称:">
-          <el-input
-            placeholder="请输入资源组名称"
-            v-model.trim="queryParams.code"
-            style="width: 150px"
-            clearable
-            @keydown.enter.prevent
-          />
+          <el-input placeholder="请输入资源组名称" v-model.trim="queryParams.code" style="width: 150px" clearable
+            @keydown.enter.prevent />
         </el-form-item>
         <el-form-item>
-          <el-button
-            type="info"
-            icon="Search"
-            :disabled="deptList.length === 0"
-            @click="handleQuery"
-            >搜索
+          <el-button type="info" icon="Search" :disabled="deptList.length === 0" @click="handleQuery">搜索
           </el-button>
         </el-form-item>
       </el-form>
       <div class="el-table-container">
         <div class="el-table-inner-container">
-          <el-table
-            ref="resourceGroupTable"
-            :data="resourceGroupList"
-            v-loading="resourceGroupLoading"
-            highlight-current-row
-            height="100%"
-            @current-change="handleResourceGroupCurrentChange"
-          >
-            <el-table-column
-              label="行号"
-              type="index"
-              width="50"
-              align="center"
-            />
-            <el-table-column
-              label="资源组名称"
-              width="70"
-              prop="code"
-              align="center"
-            />
-            <el-table-column
-              label="资源组人员"
-              width="200"
-              prop="nickName"
-              align="center"
-            />
+          <el-table ref="resourceGroupTable" :data="resourceGroupList" v-loading="resourceGroupLoading"
+            highlight-current-row height="100%" @current-change="handleResourceGroupCurrentChange">
+            <el-table-column label="行号" type="index" width="50" align="center" />
+            <el-table-column label="资源组名称" width="70" prop="code" align="center" />
+            <el-table-column label="资源组人员" width="200" prop="nickName" align="center" />
             <el-table-column label="设备编码" width="120" align="center">
               <template #default="scope">
-                <div
-                  v-for="(item, index) in scope.row.groupEquipmentList"
-                  :key="index"
-                >
+                <div v-for="(item, index) in scope.row.groupEquipmentList" :key="index">
                   <div style="height: auto">{{ item.commonCode }}</div>
                 </div>
               </template>
             </el-table-column>
             <el-table-column label="设备名称" align="center">
               <template #default="scope">
-                <div
-                  v-for="(item, index) in scope.row.groupEquipmentList"
-                  :key="index"
-                >
+                <div v-for="(item, index) in scope.row.groupEquipmentList" :key="index">
                   <div style="height: auto">{{ item.commonName }}</div>
                 </div>
               </template>
@@ -88,121 +46,48 @@
     <!-- 右侧区域 -->
     <section class="list-part-container" style="flex: 2">
       <el-form class="list-search-container" :inline="true">
-        <el-form-item
-          class="section-title"
-          label="生产计划"
-          label-width="60px"
-        />
+        <el-form-item class="section-title" label="生产计划" label-width="60px" />
         <el-form-item label="生产计划信息:">
-          <el-input
-            v-model.trim="queryItemParams.productionPlanNo"
-            placeholder="请输入厂家/生产计划单号/产品描述"
-            clearable
-            style="width: 250px"
-            @keydown.enter.prevent
-          />
+          <el-input v-model.trim="queryItemParams.productionPlanNo" placeholder="请输入厂家/生产计划单号/产品描述" clearable
+            style="width: 250px" @keydown.enter.prevent />
         </el-form-item>
         <el-form-item>
-          <el-button
-            type="info"
-            icon="Search"
-            :disabled="!currentResourceGroup.id"
-            @click="handleQueryPlanDetails"
-            >搜索
+          <el-button type="info" icon="Search" :disabled="!currentResourceGroup.id" @click="handleQueryPlanDetails">搜索
           </el-button>
-          <el-button
-            type="primary"
-            icon="Plus"
-            :disabled="!currentResourceGroup.id"
-            @click="handleOpenPlanDetailDialog()"
-            >新增
+          <el-button type="primary" icon="Plus" :disabled="!currentResourceGroup.id"
+            @click="handleOpenPlanDetailDialog()">新增
           </el-button>
-          <el-button
-            type="danger"
-            icon="Delete"
-            :disabled="!currentResourceGroup.id || planDetailIds.length == 0"
-            @click="handleDeletePlanDetail()"
-            >批量删除
+          <el-button type="danger" icon="Delete" :disabled="!currentResourceGroup.id || planDetailIds.length == 0"
+            @click="handleDeletePlanDetail()">批量删除
           </el-button>
         </el-form-item>
       </el-form>
       <div class="el-table-container">
         <div class="el-table-inner-container">
-          <el-table
-            ref="planDetailsTable"
-            v-loading="planDetailLoading"
-            row-key="id"
-            :data="planDetailList"
-            highlight-current-row
-            height="100%"
-            @selection-change="handleSelectionChange"
-          >
+          <el-table ref="planDetailsTable" v-loading="planDetailLoading" row-key="id" :data="planDetailList"
+            highlight-current-row height="100%" @selection-change="handleSelectionChange">
             <el-table-column type="selection" width="40" align="center" />
-            <el-table-column
-              type="index"
-              label="行号"
-              width="50"
-              align="center"
-            />
-            <el-table-column
-              label="厂家"
-              prop="companyAlias"
-              width="150"
-              align="center"
-            />
-            <el-table-column
-              label="生产计划单号"
-              prop="productionPlanNo"
-              width="100"
-              align="center"
-            >
-            <template #default="scope">
-              <el-button link type="primary" @click="handleColumnClick(scope.row.productionPlanNo)"><span>{{ scope.row.productionPlanNo
-                  }}</span></el-button>
-            </template></el-table-column>
-            <el-table-column
-              label="序号"
-              width="60"
-              prop="lineNumber"
-              align="center"
-            />
-            <el-table-column
-              label="产品描述"
-              prop="productDescription"
-              width="350"
-              align="center"
-            />
-            <el-table-column
-              label="投产日期"
-              prop="issuanceDate"
-              width="100"
-              align="center"
-            >
+            <el-table-column type="index" label="行号" width="50" align="center" />
+            <el-table-column label="厂家" prop="companyAlias" width="150" align="center" />
+            <el-table-column label="生产计划单号" prop="productionPlanNo" width="100" align="center">
+              <template #default="scope">
+                <el-button link type="primary" @click="handleColumnClick(scope.row.productionPlanNo)"><span>{{
+                  scope.row.productionPlanNo
+                    }}</span></el-button>
+              </template></el-table-column>
+            <el-table-column label="序号" width="60" prop="lineNumber" align="center" />
+            <el-table-column label="产品描述" prop="productDescription" width="350" align="center" />
+            <el-table-column label="投产日期" prop="issuanceDate" width="100" align="center">
               <template #default="scope">
                 <span>{{
                   proxy.moment(scope.row.issuanceDate).format("YYYY-MM-DD")
                 }}</span>
               </template>
             </el-table-column>
-            <el-table-column
-              label="批次数"
-              prop="lotTotalNumber"
-              width="70"
-              align="center"
-            ></el-table-column>
-            <el-table-column
-              fixed="right"
-              label="操作"
-              width="80"
-              align="center"
-            >
+            <el-table-column label="批次数" prop="lotTotalNumber" width="70" align="center"></el-table-column>
+            <el-table-column fixed="right" label="操作" width="80" align="center">
               <template #default="scope">
-                <el-button
-                  icon="delete"
-                  link
-                  type="danger"
-                  @click="handleDelPlanDetail(scope.row)"
-                  >删除
+                <el-button icon="delete" link type="danger" @click="handleDelPlanDetail(scope.row)">删除
                 </el-button>
               </template>
             </el-table-column>
@@ -210,19 +95,11 @@
         </div>
       </div>
       <!-- 分页 -->
-      <pagination
-        v-show="itemTotal > 0"
-        :total="itemTotal"
-        v-model:page="queryItemParams.pageNum"
-        v-model:limit="queryItemParams.pageSize"
-        @pagination="getPlanDetail"
-      />
+      <pagination v-show="itemTotal > 0" :total="itemTotal" v-model:page="queryItemParams.pageNum"
+        v-model:limit="queryItemParams.pageSize" @pagination="getPlanDetail" />
     </section>
     <!-- 生产计划分配弹窗 -->
-    <plan-detail-dialog
-      ref="planDetailRef"
-      :multiple-selected="handlePlanDetailSelected"
-    ></plan-detail-dialog>
+    <plan-detail-dialog ref="planDetailRef" :multiple-selected="handlePlanDetailSelected"></plan-detail-dialog>
   </div>
 </template>
 
@@ -310,7 +187,7 @@ function getResourceGroup() {
 /** 打开批次详情页 */
 function handleColumnClick(data) {
   console.log(data)
-  productionPlanDetailStore().setProductionPlanDetailQueryParams(data)
+  productionPlanDetailStore().setProductionPlanNo(data)
   router.push({ path: "/select/dayworkSelect/" });
 }
 
@@ -369,7 +246,7 @@ function handleDeletePlanDetail() {
         proxy.$modal.msgSuccess("删除成功!");
       });
     })
-    .catch(() => {});
+    .catch(() => { });
 }
 
 /** 生产计划带回 */
@@ -403,12 +280,11 @@ function handleDelPlanDetail(row) {
         proxy.$modal.msgSuccess("删除成功!");
       });
     })
-    .catch(() => {});
+    .catch(() => { });
 }
 
 onMounted(() => {
   getList();
 });
 </script>
-<style scoped></style>
-  
+<style scoped></style>

+ 8 - 1
src/views/business/reviseBath/index.vue

@@ -69,12 +69,13 @@
   </div>
 </template>
 
-<script setup name="lotInfo">
+<script setup name="ReviseBath">
 import { getP2Plan } from "@/api/business/p2.js";
 import producedLot from "./producedLotForm.vue";
 import productionDialog from "./DialogProduction";
 import { ref } from "vue";
 import router from "@/router";
+import queryStore from "@/store/modules/query";
 const { proxy } = getCurrentInstance();
 /** 字典数组区 */
 /** 查询 对象 */
@@ -104,6 +105,10 @@ onMounted(() => {
 /** 查询生产计划列表 */
 function getList() {
   loading.value = true;
+  const listQueryParams = queryStore().reviseBathParams;
+  if (listQueryParams != null) {
+    queryParams.value = listQueryParams;
+  }
   getP2Plan(queryParams.value).then((res) => {
     productionPlanList.value = res.rows;
     total.value = res.total;
@@ -135,6 +140,8 @@ function handleFresh() {
 /** 搜索按钮操作 */
 function handleQuery() {
   queryParams.value.pageNum = 1;
+  const listQueryParams = JSON.parse(JSON.stringify(queryParams.value));
+  queryStore().setReviseBathParams(listQueryParams);
   getList();
 }
 

+ 47 - 145
src/views/business/searchPosition/index.vue

@@ -1,48 +1,24 @@
 <template>
   <div class="page-container column-container">
     <!-- 搜索区 -->
-    <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 label="产品描述:" prop="productDescription">
-        <el-input
-          v-model="queryParams.productDescription"
-          placeholder="请输入产品描述"
-          style="width: 144px"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.productDescription" placeholder="请输入产品描述" style="width: 144px" clearable
+          @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item label="批次号:" prop="lotCode">
-        <el-input
-          v-model="queryParams.lotCode"
-          placeholder="请输入批次号"
-          style="width: 144px"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.lotCode" placeholder="请输入批次号" style="width: 144px" clearable
+          @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item label="工段:">
-        <el-autocomplete
-          v-model.trim="deptName"
-          clearable
-          :fetch-suggestions="queryDeptSearchAsync"
-          placeholder="请选择工段"
-          @select="handleDeptSelect"
-          style="width: 140px"
-          @clear="handleClearDept"
-        >
+        <el-autocomplete v-model.trim="deptName" clearable :fetch-suggestions="queryDeptSearchAsync" placeholder="请选择工段"
+          @select="handleDeptSelect" style="width: 140px" @clear="handleClearDept">
           <template #default="{ item }">
-            <div
-              style="
+            <div style="
                 display: flex;
                 flex-direction: row;
                 justify-content: space-between;
-              "
-            >
+              ">
               <div class="name" style="font-size: 12px">
                 {{ item.deptName }}
               </div>
@@ -51,140 +27,54 @@
         </el-autocomplete>
       </el-form-item>
       <el-form-item class="section-title" label="车间:">
-          <el-select-v2
-            v-model="queryParams.workshopId"
-            clearable
-            :options="workshopList"
-            placeholder="请选择车间"
-            style="width: 100%"
-          />
-        </el-form-item>
+        <el-select-v2 v-model="queryParams.workshopId" clearable :options="workshopList" placeholder="请选择车间"
+          style="width: 100%" />
+      </el-form-item>
       <el-form-item label="箱号:" prop="carrierCode">
-        <el-input
-          v-model="queryParams.carrierCode"
-          placeholder="请输入箱号"
-          style="width: 144px"
-          clearable
-          @keyup.enter="handleQuery"
-        />
+        <el-input v-model="queryParams.carrierCode" placeholder="请输入箱号" style="width: 144px" clearable
+          @keyup.enter="handleQuery" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
       </el-form-item>
     </el-form>
     <!-- 渲染数据区 -->
     <div class="el-table-container">
       <div class="el-table-inner-container">
-        <el-table
-          v-loading="loading"
-          :data="dataList"
-          size="small"
-          border
-          height="100%"
-        >
-          <el-table-column
-            label="客户简称"
-            align="center"
-            prop="companyAlias"
-            width="120"
-          />
-          <el-table-column
-            label="生产计划单号"
-            align="center"
-            prop="productionPlanNo"
-            width="120"
-          />
-          <el-table-column
-            label="序号"
-            align="center"
-            prop="lineNumber"
-            width="70"
-          />
-          <el-table-column
-            label="批次号"
-            align="center"
-            prop="lotCode"
-            width="120"
-          > <template #default="scope">
+        <el-table v-loading="loading" :data="dataList" size="small" border height="100%">
+          <el-table-column label="客户简称" align="center" prop="companyAlias" width="120" />
+          <el-table-column label="生产计划单号" align="center" prop="productionPlanNo" width="120" />
+          <el-table-column label="序号" align="center" prop="lineNumber" width="70" />
+          <el-table-column label="批次号" align="center" prop="lotCode" width="120"> <template #default="scope">
               <el-button link type="primary" @click="handleColumnClick(scope.row.lotCode)"><span>{{ scope.row.lotCode
                   }}</span></el-button>
             </template>
           </el-table-column>
-          <el-table-column
-            label="产品描述"
-            align="center"
-            prop="productDescription"
-          />
-          <el-table-column
-            label="图纸版本"
-            align="center"
-            prop="technologyVersion"
-            width="120"
-          />
-          <el-table-column
-            label="投产量"
-            align="center"
-            prop="productionQuantity"
-            width="120"
-          />
-          <el-table-column
-            label="当前车间"
-            align="center"
-            prop="workshopName"
-            width="120"
-          />
-          <el-table-column
-            label="当前工段"
-            align="center"
-            prop="deptName"
-            width="120"
-          />
-          <el-table-column
-            label="当前工序"
-            align="center"
-            prop="processAlias"
-            width="120"
-          />
-          <el-table-column
-            label="车间周转区"
-            align="center"
-            prop="turnoverArea"
-            width="150"
-          />
-          <el-table-column
-            label="工段周转区"
-            align="center"
-            prop="place"
-            width="150"
-          />
-          <el-table-column
-            label="箱号"
-            align="centerName"
-            prop="carrierName"
-            width="120"
-          />
+          <el-table-column label="产品描述" align="center" prop="productDescription" />
+          <el-table-column label="图纸版本" align="center" prop="technologyVersion" width="120" />
+          <el-table-column label="投产量" align="center" prop="productionQuantity" width="120" />
+          <el-table-column label="当前车间" align="center" prop="workshopName" width="120" />
+          <el-table-column label="当前工段" align="center" prop="deptName" width="120" />
+          <el-table-column label="当前工序" align="center" prop="processAlias" width="120" />
+          <el-table-column label="车间周转区" align="center" prop="turnoverArea" width="150" />
+          <el-table-column label="工段周转区" align="center" prop="place" width="150" />
+          <el-table-column label="箱号" align="centerName" prop="carrierName" width="120" />
         </el-table>
       </div>
     </div>
 
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
   </div>
 </template>
 
 <script setup name="SearchPosition">
 import { listDept } from "@/api/system/dept";
 import { getDeptList } from "@/api/system/dept.js";
-import {getLotPosition} from "@/api/business/daywork";
-import {listWorkshop} from "@/api/business/workshop";
+import { getLotPosition } from "@/api/business/daywork";
+import { listWorkshop } from "@/api/business/workshop";
+import queryStore from "@/store/modules/query";
 import router from "@/router";
 const { proxy } = getCurrentInstance();
 
@@ -207,12 +97,15 @@ const queryParams = ref({
 
 /***********************  方法区  ****************************/
 function getDept() {
-  resetQuery()
+  // resetQuery()
   //获取工段信息
   getDeptList({ type: 0, isWorkSection: 1 }).then((res) => {
     if (res.code == 200) {
       deptList.value = res.data;
     }
+    if (queryStore().searchPositionParams != null) {
+      deptName.value = queryStore().searchPositionParams.deptName;
+    }
   });
   getWorkshop()
   getList()
@@ -232,6 +125,11 @@ function getWorkshop() {
 带箱方式,是整单的。如果换新箱子,明细中,都需要更换箱子列表 */
 function getList() {
   loading.value = true;
+  const listQueryParams = queryStore().searchPositionParams;
+  if (listQueryParams != null) {
+    queryParams.value = listQueryParams;
+  }
+  console.log('listQueryParams', listQueryParams)
   getLotPosition(queryParams.value).then((response) => {
     dataList.value = response.rows;
     total.value = response.total;
@@ -242,6 +140,8 @@ function getList() {
 /** 搜索按钮操作 */
 function handleQuery() {
   queryParams.value.pageNum = 1;
+  const listQueryParams = JSON.parse(JSON.stringify(queryParams.value));
+  queryStore().setSearchPositionParams(listQueryParams);
   getList();
 }
 
@@ -268,10 +168,12 @@ const queryDeptSearchAsync = (arg, cb) => {
 const handleDeptSelect = (item) => {
   console.log(item);
   deptName.value = item.deptName.trim();
+  queryParams.value.deptName = deptName.value;
   queryParams.value.deptId = item.deptId;
 };
 const handleClearDept = () => {
   deptName.value = "";
+  queryParams.value.deptName = ''
   queryParams.value.deptId = null;
 };
 

+ 46 - 48
src/views/business/sortReject/index.vue

@@ -19,7 +19,7 @@
                         :editable="false" clearable placeholder="请选择" style="width: 136px" />
                     <span>~</span>
                     <el-date-picker v-model="queryParams.endTime" type="date" value-format="YYYY-MM-DD"
-                        :editable="false" clearable placeholder="请选择" style="width: 136px"/>
+                        :editable="false" clearable placeholder="请选择" style="width: 136px" />
                 </el-form-item>
                 <el-form-item style="margin-left: 0">
                     <el-button type="info" icon="Search" @click="handleQuery">搜索
@@ -33,7 +33,7 @@
                         highlight-current-row height="100%" style="overflow-x: auto;">
                         <el-table-column label="序号" width="60" prop="lineNumber" align="center" />
                         <el-table-column label="规格" prop="specification" width="100" align="center" />
-                        <el-table-column label="日期" prop="date" align="center" width="100"/>
+                        <el-table-column label="日期" prop="date" align="center" width="100" />
                         <el-table-column label="批次号" prop="lotCode" width="110" align="center" />
                         <el-table-column label="产品描述" prop="productDescription" align="center" width="auto" />
                         <el-table-column label="分选量" prop="firstSortProd" width="70" align="center" />
@@ -44,37 +44,29 @@
                         <el-table-column label="不明率" prop="unknownRate" width="70" align="center" />
                         <el-table-column label="批次率" prop="lotRate" width="70" align="center" />
                         <template v-for="column in sortCheckStandardList" :key="column.id">
-                            <el-table-column 
-                                :prop="column.inspectionInstructionId" 
-                                :label="column.checkStandard" 
-                                width="80px" 
-                                align="center"
-                            >
-                            <template #default="scope">
-                                {{ getSortCheck(scope.row.checkStandardList,column.inspectionInstructionId) }}
-                            </template>
+                            <el-table-column :prop="column.inspectionInstructionId" :label="column.checkStandard"
+                                width="80px" align="center">
+                                <template #default="scope">
+                                    {{ getSortCheck(scope.row.checkStandardList, column.inspectionInstructionId) }}
+                                </template>
                             </el-table-column>
-                            </template>
+                        </template>
                     </el-table>
                 </div>
             </div>
-                      <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getSortCheckStandardList"
-    />
+            <!-- 分页 -->
+            <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+                v-model:limit="queryParams.pageSize" @pagination="getSortCheckStandardList" />
         </section>
 
     </div>
 </template>
 
 <script setup>
-import { getSortCheckStandard,getSortRejectList,printSortReject } from "@/api/business/dayworkItemReject.js";
+import { getSortCheckStandard, getSortRejectList, printSortReject } from "@/api/business/dayworkItemReject.js";
 import { ref } from "vue";
 import { flattenDeep } from 'lodash-es';
+import queryStore from "@/store/modules/query";
 
 const { proxy } = getCurrentInstance();
 /** 报工信息 */
@@ -85,10 +77,10 @@ const data = ref([])
 const sortRejectLoading = ref(false);
 
 const queryParams = ref({
-    lotCode:null,
+    lotCode: null,
     productDescription: null,
-    startTime:null,
-    endTime:null,
+    startTime: null,
+    endTime: null,
     pageNum: 1,
     pageSize: 10
 });
@@ -100,7 +92,11 @@ function getList() {
     getSortCheckStandardList()
 }
 function getSortCheckStandardList() {
-    getSortCheckStandard(queryParams.value).then(res =>{
+    const listQueryParams = queryStore().sortRejectParams;
+    if (listQueryParams != null) {
+        queryParams.value = listQueryParams;
+    }
+    getSortCheckStandard(queryParams.value).then(res => {
         sortCheckStandardList.value = res.data
     })
     //查询分选废品
@@ -109,15 +105,15 @@ function getSortCheckStandardList() {
 function handlePrint() {
     printSortReject(queryParams.value)
 }
-function getSortCheck(row,data) {
-    if(row.length > 0){
+function getSortCheck(row, data) {
+    if (row.length > 0) {
         // console.log(row)
-       let ids =  row.map(item =>item.inspectionInstructionId)
-       if(ids.findIndex(item => item == data) > -1) {
-        return row[ids.findIndex(item =>item == data)].rejectNum
-       }else{
-        return '';
-       }
+        let ids = row.map(item => item.inspectionInstructionId)
+        if (ids.findIndex(item => item == data) > -1) {
+            return row[ids.findIndex(item => item == data)].rejectNum
+        } else {
+            return '';
+        }
     }
     return ''
 }
@@ -130,32 +126,32 @@ function getSortReject() {
     sortRejectLoading.value = true;
     getSortRejectList(queryParams.value).then(res => {
         let list = []
-        for(let i = 0; i < res.rows.length; i++) {
+        for (let i = 0; i < res.rows.length; i++) {
             let index = i
             let data = res.rows[i]
             data.lineNumber = index + 1
             list.push(data)
-            if((index != res.rows.length - 1 && res.rows[i].productionPlanDetailId !=  res.rows[i+1].productionPlanDetailId) ||(index != res.rows.length - 1 && res.rows[i].date !=  res.rows[i+1].date) ||index == res.rows.length - 1) {
+            if ((index != res.rows.length - 1 && res.rows[i].productionPlanDetailId != res.rows[i + 1].productionPlanDetailId) || (index != res.rows.length - 1 && res.rows[i].date != res.rows[i + 1].date) || index == res.rows.length - 1) {
                 let checkList = []
                 let total = {}
-                total.specification ="小计"
-                let equalsPro = res.rows.filter(item =>item.productionPlanDetailId == res.rows[index].productionPlanDetailId && item.date == res.rows[index].date)
-               
+                total.specification = "小计"
+                let equalsPro = res.rows.filter(item => item.productionPlanDetailId == res.rows[index].productionPlanDetailId && item.date == res.rows[index].date)
+
                 let check = computed(() => flattenDeep(equalsPro.map(item => item.checkStandardList))).value
-                let standardIds = check.map(item => {return item.inspectionInstructionId })
+                let standardIds = check.map(item => { return item.inspectionInstructionId })
                 standardIds.forEach(item => {
                     let info = {}
                     let sum = check.filter(info => info.inspectionInstructionId == item)
-                 .reduce((acc, obj) => {
-                     // 确保 acc 和 obj.rejectNum 都是数字
-                     return acc + parseInt(obj.rejectNum);
-                 }, 0); // 提供初始值 0
-                     info.inspectionInstructionId = item
-                info.rejectNum = sum
-                checkList.push(info)
+                        .reduce((acc, obj) => {
+                            // 确保 acc 和 obj.rejectNum 都是数字
+                            return acc + parseInt(obj.rejectNum);
+                        }, 0); // 提供初始值 0
+                    info.inspectionInstructionId = item
+                    info.rejectNum = sum
+                    checkList.push(info)
                 });
-               total.checkStandardList = checkList
-               list.push(total)
+                total.checkStandardList = checkList
+                list.push(total)
             }
         }
         console.log(list)
@@ -167,6 +163,8 @@ function getSortReject() {
 }
 /** 搜索按钮操作 */
 function handleQuery() {
+    const listQueryParams = JSON.parse(JSON.stringify(queryParams.value));
+    queryStore().setSortRejectParams(listQueryParams);
     getSortCheckStandardList()
 }