Explorar o código

批次详情中,增加查看检查信息按钮

zhuangdezheng hai 3 días
pai
achega
534308944f

+ 2 - 1
package.json

@@ -34,6 +34,7 @@
     "pinia": "2.0.22",
     "print-js": "^1.6.0",
     "qs": "^6.11.2",
+    "ruoyi": "file:",
     "sortable.js": "^0.3.0",
     "sortablejs": "^1.15.2",
     "vue": "3.2.45",
@@ -53,4 +54,4 @@
     "vite-plugin-svg-icons": "2.0.1",
     "vite-plugin-vue-setup-extend": "0.4.0"
   }
-}
+}

+ 40 - 6
src/views/business/processInspection/index.vue

@@ -93,7 +93,7 @@
   </div>
 </template>
 
-<script setup name="processInspection">
+<script setup name="ProcessInspection">
 import {
   listInspecion,
   getInspectionType,
@@ -101,13 +101,14 @@ import {
 import { getDeptList } from "@/api/business/planDetailSubDetail.js";
 import processInspectionForm from "./form.vue";
 const webHost = import.meta.env.VITE_APP_BASE_API;
-import { ref } from "vue";
+import { ref, watchEffect } from "vue";
+const route = useRoute();
 const { proxy } = getCurrentInstance();
 /** 字典数组区 */
 const { process_inspection_status } = proxy.useDict(
   "process_inspection_status"
 );
-
+const isFirstActivation = ref(true)
 /** 序检 */
 const processInspectionTable = ref(null);
 const inspectionList = ref([]);
@@ -132,7 +133,6 @@ const queryParams = ref({
 
 /***********************  工段相关事件  ****************************/
 function getList() {
-  getNowDate();
   loading.value = true;
   getTypeList();
   getDeptList().then((response) => {
@@ -142,7 +142,6 @@ function getList() {
     if (isDispatch.value) {
       deptList.value.unshift({ label: "全部", value: "0" });
     }
-    console.log(deptList.value)
     let index = deptList.value.findIndex((item) => {
       return item.deptCode == "170000";
     });
@@ -218,8 +217,43 @@ function handleViewImage(row) {
 }
 
 onMounted(() => {
-  getList();
+  // const hasVisited = sessionStorage.getItem('visited');
+  // if (!hasVisited || hasVisited === 'false') {
+    getNowDate();
+    //sessionStorage.setItem('visited', true);
+    if (route.query && route.query.lotCode) {
+      queryParams.value.lotCode = route.query.lotCode;
+      queryParams.value.startTime = null;
+      queryParams.value.endTime = null;
+    }
+    getList();
+  //}
 });
+
+onActivated(() => {
+  if (isFirstActivation.value) {
+    isFirstActivation.value = false;
+  } else{
+    if (route.query && route.query.lotCode) {
+      queryParams.value.lotCode = route.query.lotCode;
+      const noLotCode = sessionStorage.getItem('noLotCode');
+      if (!noLotCode || noLotCode === 'true') {
+        queryParams.value.startTime = null;
+        queryParams.value.endTime = null;
+        sessionStorage.setItem('noLotCode', 'false');
+      }
+    } else {
+      queryParams.value.lotCode = ''
+      sessionStorage.setItem('noLotCode', 'true');
+      getNowDate();
+    }
+    getList();
+  }
+});
+
+onDeactivated(() => {
+  // 离开时清空sessionStorage
+})
 </script>
 <style scoped>
 .el-form--inline .el-form-item {

+ 13 - 0
src/views/business/reviseBath/lotFormParticulars.vue

@@ -18,6 +18,9 @@
           }}</el-tag>
           <el-tag v-if="lot.isWasteRecycling == 1" class="spacing" type="primary">{{ "废品回用" }}</el-tag>
         </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="handleViewCheckInfo">查看检查信息</el-button>
+        </el-form-item>
       </el-row>
 
       <el-row :gutter="24" style="margin-top: 10px">
@@ -270,6 +273,7 @@ const processList = ref([]); //工序列表
 const permissions = useUserStore().permissions;
 const all_permission = "*:*:*";
 const route = useRoute();
+const router = useRouter();
 const inBatchesDialogRef = ref(null);
 const statusMap = {
   0: { type: "info", text: "未开始" },
@@ -286,6 +290,15 @@ const lot = ref({
 }); //批次信息
 
 /****************************  方法区  ****************************/
+/**
+ * 查看检查信息
+ */
+const handleViewCheckInfo = () => {
+  router.push({
+    path: "/quality/processInspection",
+    query: { lotCode: route.params.lotCode }
+  })
+}
 /** 单批单改按钮操作 */
 function handleOnceSingleChange() {
   if (lot.value.isWaste == 1) {