wangxin 11 сар өмнө
parent
commit
b61ef89e5f

+ 22 - 9
src/views/business/lot/index.vue

@@ -305,11 +305,11 @@
     />
     <waste-recycling-dialog
       ref="wasteRecyclingDialogRef"
-      @handleSaveSuccess="getLot()"
+      @handleSaveSuccess="getLot"
     ></waste-recycling-dialog>
     <InBatchesDialog ref="inBatchesDialogRef" :getList="handleQuerydaywork" />
-    <once-change ref="onceChangeRef" @handleSaveSuccess="getLot()" />
-    <multi-change ref="multiChangeRef" @handleSaveSuccess="getLot()" />
+    <once-change ref="onceChangeRef" @handleSaveSuccess="getLot" />
+    <multi-change ref="multiChangeRef" @handleSaveSuccess="getLot" />
   </div>
 </template>
 <script setup name="ProductionPlan">
@@ -346,11 +346,15 @@ const deptList = ref([]);
 const queryParams = ref({
   pageNum: 1,
   pageSize: 10,
+  productDescription: "",
+  productionPlanNo: "",
   lotCode: "",
   deptId: null,
   flag: null,
-  productionPlanNo: "",
   lineNumber: null,
+  deptName: "",
+  startTime: "",
+  endTime: "",
 });
 const queryDeptParams = ref({
   lineNumber: "",
@@ -369,7 +373,11 @@ function getDept() {
     if (res.code == 200) {
       deptList.value = res.data;
     }
+    if (lotStore().lotQueryParams != null) {
+      deptName.value = lotStore().lotQueryParams.deptName;
+    }
   });
+
   getProcess();
   if (route.params.productionPlanNo != ":productionPlanNo") {
     queryParams.value.productionPlanNo = route.params.productionPlanNo;
@@ -440,10 +448,11 @@ function handleOnceSingleChange() {
 
 /**获取生产计划列表 */
 function getLot() {
-  console.log("storeLot", lotStore().lotQueryParams);
+  const lotQueryParams = lotStore().lotQueryParams;
+  console.log("getLot", lotQueryParams);
 
-  if (lotStore().lotQueryParams != null) {
-    queryParams.value = lotStore().lotQueryParams;
+  if (lotQueryParams != null) {
+    queryParams.value = lotQueryParams;
   }
 
   loading.value = true;
@@ -522,7 +531,9 @@ function handleQuerydaywork() {
   ) {
     proxy.$modal.msgError("结束时间不能小于开始时间");
   } else {
-    lotStore().setlotQueryParams(queryParams.value);
+    const lotQueryParams = JSON.parse(JSON.stringify(queryParams.value));
+    console.log("lotQueryParams", lotQueryParams);
+    lotStore().setlotQueryParams(lotQueryParams);
     getLot();
   }
 }
@@ -605,6 +616,7 @@ 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 handleClearProcess = () => {
@@ -622,8 +634,9 @@ const checkRecycle = () => {
   // 判断是否是废品回用,废品回用的无论分批还是单批单改多批单改废品回用都不能做
   return selections.value.some((v) => v.isWasteRecycling == 1);
 };
-getLot();
+
 onMounted(() => {
   getDept();
+  // getLot();
 });
 </script>