|
@@ -313,7 +313,12 @@ const getContractData = async () => {
|
|
projectId: projectId.value,
|
|
projectId: projectId.value,
|
|
contractId: contractId.value,
|
|
contractId: contractId.value,
|
|
})
|
|
})
|
|
- contractData.value = getArrValue(data)
|
|
|
|
|
|
+ const res = getArrValue(data)
|
|
|
|
+ contractData.value = res
|
|
|
|
+ if (res.length > 0) {
|
|
|
|
+ searchForm.value.contractId = res[0].id
|
|
|
|
+ searchClick()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//获取用户列表
|
|
//获取用户列表
|
|
@@ -405,25 +410,22 @@ const tableLoading = ref(false)
|
|
const tableData = ref([])
|
|
const tableData = ref([])
|
|
const getTableData = async () => {
|
|
const getTableData = async () => {
|
|
const nodeId = primaryKeyId.value
|
|
const nodeId = primaryKeyId.value
|
|
- if (nodeId) {
|
|
|
|
- tableLoading.value = true
|
|
|
|
- const { error, code, data } = await samplingApi.queryPage({
|
|
|
|
- projectId: projectId.value,
|
|
|
|
- contractId: contractId.value,
|
|
|
|
- nodeId,
|
|
|
|
- ...searchForm.value,
|
|
|
|
- })
|
|
|
|
- //处理数据
|
|
|
|
- tableLoading.value = false
|
|
|
|
- if (!error && code === 200) {
|
|
|
|
- tableData.value = getArrValue(data['records'])
|
|
|
|
- searchForm.value.total = data.total || 0
|
|
|
|
- } else {
|
|
|
|
- tableData.value = []
|
|
|
|
- searchForm.value.total = 0
|
|
|
|
- }
|
|
|
|
|
|
+ if (isNullES(nodeId)) return
|
|
|
|
+ tableLoading.value = true
|
|
|
|
+ const { error, code, data } = await samplingApi.queryPage({
|
|
|
|
+ projectId: projectId.value,
|
|
|
|
+ contractId: contractId.value,
|
|
|
|
+ nodeId,
|
|
|
|
+ ...searchForm.value,
|
|
|
|
+ })
|
|
|
|
+ //处理数据
|
|
|
|
+ tableLoading.value = false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ tableData.value = getArrValue(data['records'])
|
|
|
|
+ searchForm.value.total = data.total || 0
|
|
} else {
|
|
} else {
|
|
- window?.$message?.warning('请先选择一个树节点')
|
|
|
|
|
|
+ tableData.value = []
|
|
|
|
+ searchForm.value.total = 0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|