|
@@ -50,6 +50,10 @@ import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
|
import samplingApi from '~api/tentative/material/sampling'
|
|
|
import { getArrValue } from 'js-fast-way'
|
|
|
|
|
|
+//参数
|
|
|
+const props = defineProps({
|
|
|
+ cid: [String, Number],
|
|
|
+})
|
|
|
//变量
|
|
|
const useAppState = useAppStore()
|
|
|
const userInfo = ref(useAppState.getUserInfo)
|
|
@@ -83,6 +87,11 @@ const treeAutoExpandKeys = ref(getStoreValue('testTreeExpandKeys') || [])
|
|
|
//搜索表单
|
|
|
const searchForm = ref({ current: 1, size: 20, total: 0 })
|
|
|
|
|
|
+//监听
|
|
|
+watch(() => props.cid, (cid) => {
|
|
|
+ searchForm.value.contractId = cid
|
|
|
+}, { immediate:true, deep:true })
|
|
|
+
|
|
|
//获取合同段信息
|
|
|
const contractData = ref([])
|
|
|
const getContractData = async () => {
|
|
@@ -90,11 +99,7 @@ const getContractData = async () => {
|
|
|
projectId: projectId.value,
|
|
|
contractId: contractId.value,
|
|
|
})
|
|
|
- const res = getArrValue(data)
|
|
|
- contractData.value = res
|
|
|
- if (res.length > 0) {
|
|
|
- searchForm.value.contractId = res[0].id
|
|
|
- }
|
|
|
+ contractData.value = getArrValue(data)
|
|
|
}
|
|
|
|
|
|
//树被点击
|