duy 3 months ago
parent
commit
85352d0c40

+ 22 - 13
src/views/tentative/detect/components/basicInfo.vue

@@ -228,7 +228,7 @@
             </div>
         </hc-new-dialog>
         <!-- 关联委托单 -->
-        <LinkAssociation v-model="isLinksAssociation" :cid="contractId" @change="commissionChange" @close="isLinksAssociation = false" />
+        <LinkAssociation v-model="isLinksAssociation" :cid="contractId" :ids="ids" @change="commissionChange" @close="isLinksAssociation = false" />
 
         <!-- 关联设备数据 -->
         <hc-new-dialog v-model="isLinkAcquisition" is-table is-footer-center title="关联设备数据" widths="80%" @close="linksAcquisitionClose">
@@ -268,6 +268,11 @@ const props = defineProps({
         type: [String, Number],
         default: '',
     },
+    ids:{
+        type: [String, Number],
+        default: '', //委托单id
+
+    },
 })
 
 
@@ -280,14 +285,14 @@ const nodeId = ref(props.nodeId)
 const dataId = ref(props.dataId)
 const projectId = ref(props.projectId)
 const contractId = ref(props.contractId)
-
+const ids = ref(props.ids)
 const handleSave = () => {}
 const handleRefresh = () => {}
 const isShow = defineModel('modelValue', {
     default: false,
 })
 const standardId = ref('')
-const ypList = ref([]) // 确保 ypList 已定义
+const ypList = ref(null) // 确保 ypList 已定义
 const ypLoad = ref(false)
 const getYpList = async (id)=>{
         ypLoad.value = true
@@ -297,7 +302,9 @@ const getYpList = async (id)=>{
     //处理数据
     ypLoad.value = false
     if (!error && code === 200) {
-        ypList.value = getArrValue(data)
+        ypList.value = getObjValue(data)
+        console.log(ypList.value, 'ypList')
+        
        
     } else {
         ypList.value = []
@@ -318,13 +325,16 @@ watch(() => [
     props.nodeId,
     props.projectId,
     props.contractId,
+    props.ids,
     
    
-], ([did, nid, pid, cid]) => {
+], ([did, nid, pid, cid, id]) => {
     dataId.value = did
     nodeId.value = nid
     projectId.value = pid
     contractId.value = cid
+    ids.value = id
+
 
 
 })
@@ -494,8 +504,10 @@ const linkCommission = ()=>{
 const isLinksAssociation = ref(false)
 
 //委托单确定选择
-const commissionChange = (id) => {
-    console.log(id)
+const commissionChange = (id, data) => {
+
+    basicInfoData.value.entrustNo = data.specificationNumber
+
    
 }
 
@@ -514,12 +526,9 @@ const linkAcquisitionClick = (item, index) => {
 const linksAcquisitionLoading = ref(false)
 const linksAcquisitionClick = async () => {
     linksAcquisitionLoading.value = true
-    const item = linkAcquisitionRow.value
-    const index = linkAcquisitionIndex.value
-    const dataId = linkAcquisitionLoadDataId.value
-    listDatas.value[index].loadDataId = dataId
-    formData.value[index].loadDataId = dataId
-    await tableFormSaveClick(item, index)
+
+   
+
     linksAcquisitionClose()
 }
 

+ 3 - 2
src/views/tentative/detect/components/linkAcquisition.vue

@@ -46,7 +46,7 @@
                 </template>
                 <template #action="{ row }">
                     <el-link v-if="dataIds.indexOf(row.id) !== -1" type="warning" @click="rowCancel(row.id)">取消选择</el-link>
-                    <el-link v-else type="primary" @click="rowSelect(row.id)">选择</el-link>
+                    <el-link v-else type="primary" @click="rowSelect(row.id, row)">选择</el-link>
                     <!-- el-link v-if="row.key24 === 2" type="info">选择</el-link -->
                 </template>
             </hc-table>
@@ -316,7 +316,8 @@ const getTableData = async () => {
 }
 
 //选择
-const rowSelect = (id) => {
+const checkRows = ref([])
+const rowSelect = (id, row) => {
     const ids = deepClone(dataIds.value)
     if (ids.length >= 7) {
         window?.$message.warning('最多只能选择7条数据关联')

+ 5 - 1
src/views/tentative/detect/components/linkAssociation.vue

@@ -184,9 +184,11 @@ const getTableData = async () => {
 const currentId = ref(null)
 const rowSelect = async ({ id }) => {
     isCountShow.value = true
+     formModel.value = {}
     currentId.value = id
     const { data } = await mainApi.detail(id)
     formModel.value = getObjValue(data)
+
 }
 
 //取消选择
@@ -197,6 +199,8 @@ const rowCancel = () => {
 
 //确认关联取样材料
 const linkSamplingClick = () => {
+ 
+    
     emit('change', curId.value)
     linkSamplingClose()
 }
@@ -238,6 +242,6 @@ const linkCountClick = async () => {
 //取消
 const linkCountClose = () => {
     isCountShow.value = false
-    formModel.value = {}
+    // formModel.value = {}
 }
 </script>

+ 1 - 1
src/views/tentative/detect/test-form.vue

@@ -203,7 +203,7 @@
 
         <!-- 关联委托单 -->
         <LinkAssociation v-model="isLinksAssociation" :ids="listItemBaseData.commissionId" :cid="contractId" @change="commissionChange" @close="isLinksAssociation = false" />
-        <basicInfo v-model="isShowBasic" :node-id="nodeId" :data-id="dataId.length > 0 ? dataId : nodeIdvalue" :project-id="projectId" :contract-id="contractId" />
+        <basicInfo v-model="isShowBasic" :node-id="nodeId" :data-id="dataId.length > 0 ? dataId : nodeIdvalue" :project-id="projectId" :contract-id="contractId" :ids="listItemBaseData.commissionId" />
     </div>
 </template>