ZaiZai 11 månader sedan
förälder
incheckning
9bf878bbda

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240906091221"
+  "value": "20240906111327"
 }

+ 1 - 1
src/views/tentative/detect/commission.vue

@@ -100,7 +100,7 @@
         </hc-new-dialog>
 
         <!-- 关联取样材料 -->
-        <SamplingPage v-model="linkSamplingModal" v-model:id="delegateHtmlForm.sampleId" />
+        <SamplingPage v-model="linkSamplingModal" v-model:id="delegateHtmlForm.sampleId" :cid="searchForm.contractId" />
 
         <!-- 创建报告 -->
         <hc-new-dialog v-model="rowActionModal" is-footer-center title="创建报告" widths="40rem" @close="rowActionModalClose">

+ 10 - 5
src/views/tentative/detect/commission/sampling.vue

@@ -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)
 }
 
 //树被点击