|
|
|
@ -2021,6 +2021,24 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 🔑 监听路由参数变化,处理组件复用的情况 |
|
|
|
watch: { |
|
|
|
'$route.query.inspectionNo': { |
|
|
|
handler (newVal) { |
|
|
|
if (newVal) { |
|
|
|
// 将检验单号放入筛选条件的检验单号输入框中 |
|
|
|
this.searchData.inspectionNo = newVal |
|
|
|
|
|
|
|
// 自动执行查询 |
|
|
|
this.$nextTick(() => { |
|
|
|
this.getDataList() |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
immediate: false // 不立即执行,由 created 处理首次加载 |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
created () { |
|
|
|
// 按钮控制 |
|
|
|
this.getButtonAuthData() |
|
|
|
@ -2035,41 +2053,16 @@ |
|
|
|
this.getTableUserColumn(this.$route.meta.menuId+'table1',1) |
|
|
|
this.getTableUserColumn(this.$route.meta.menuId+'table2',2) |
|
|
|
|
|
|
|
// 接收路由参数,如果有 inspectionNo 则设置为查询条件,并清空其他筛选条件 |
|
|
|
// 接收路由参数,如果有 inspectionNo 则设置为检验单号筛选条件 |
|
|
|
if (this.$route.query.inspectionNo) { |
|
|
|
// 重置 searchData,只保留必要的字段和 inspectionNo |
|
|
|
this.searchData = { |
|
|
|
site: '', |
|
|
|
userName: this.$store.state.user.name, |
|
|
|
inspectionNo: this.$route.query.inspectionNo, |
|
|
|
inspectionTypeNo: '105', |
|
|
|
isQualified: '', |
|
|
|
buNo: '', |
|
|
|
startDate: '', |
|
|
|
endDate: '', |
|
|
|
startDate2: '', |
|
|
|
endDate2: '', |
|
|
|
partNo: '', |
|
|
|
partDesc: '', |
|
|
|
cinvSourceCode: '', |
|
|
|
sku: '', |
|
|
|
state: '', |
|
|
|
inspectionResult: '', |
|
|
|
supplierDesc: '', |
|
|
|
disposalMeasures: '', |
|
|
|
inspectorName: '', |
|
|
|
page: 1, |
|
|
|
limit: 10, |
|
|
|
poOrderNo: '', |
|
|
|
poItemNo: '', |
|
|
|
orderType: '', |
|
|
|
states: ['未开始', '待检验'], |
|
|
|
submissionType: '', |
|
|
|
invdefinetype: '' |
|
|
|
} |
|
|
|
} |
|
|
|
// 🔑 将检验单号放入筛选条件的检验单号输入框中 |
|
|
|
this.searchData.inspectionNo = this.$route.query.inspectionNo |
|
|
|
|
|
|
|
if (!this.authSearch) { |
|
|
|
// 🔑 重要:当有路由参数时,需要自动执行查询 |
|
|
|
this.$nextTick(() => { |
|
|
|
this.getDataList() |
|
|
|
}) |
|
|
|
} else if (!this.authSearch) { |
|
|
|
// 获取数据列表 |
|
|
|
this.getDataList() |
|
|
|
} |
|
|
|
|