|
@@ -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 {
|