ZaiZai 11 luni în urmă
părinte
comite
ab2c770ed2

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240909134348"
+  "value": "20240909174342"
 }

+ 11 - 4
src/views/tentative/detect/commission.vue

@@ -100,7 +100,7 @@
         </hc-new-dialog>
 
         <!-- 关联取样材料 -->
-        <SamplingPage v-model="linkSamplingModal" v-model:id="delegateHtmlForm.sampleId" :cid="searchForm.contractId" />
+        <SamplingPage v-model="linkSamplingModal" v-model:id="delegateHtmlForm.sampleId" :cid="searchForm.contractId" @change="linkSamplingChange" />
 
         <!-- 创建报告 -->
         <hc-new-dialog v-model="rowActionModal" is-footer-center title="创建报告" widths="40rem" @close="rowActionModalClose">
@@ -326,7 +326,7 @@ const addFormData = () => {
 //合同段被选择
 const delegateContractChange = async () => {
     delegateHtmlLoading.value = true
-    await getDelegateDataInfo(editHtmlId.value)
+    //await getDelegateDataInfo(editHtmlId.value)
     await getDelegateExcelHtml()
     delegateHtmlLoading.value = false
 }
@@ -346,11 +346,18 @@ const getDelegateExcelHtml = async () => {
     }
 }
 
+//关联材料选择
+const linkSamplingChange = async ({ id, entrustId }) => {
+    await getDelegateDataInfo(id, entrustId)
+    await getDelegateExcelHtml()
+}
+
 //获取委托数据
-const getDelegateDataInfo = async (editId) => {
+const getDelegateDataInfo = async (id, entrustId) => {
     const { primaryKeyId } = nodeDataInfo.value
     const { error, code, msg, data } = await samplingApi.getBussDataInfoTrialEntrust({
-        id: editId ?? null,
+        id: entrustId,
+        sampleId: id,
         pkeyId: nodeErTreeId.value,
         projectId: projectId.value,
         contractId: delegateContractId.value,

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

@@ -54,6 +54,8 @@ import { getArrValue } from 'js-fast-way'
 const props = defineProps({
     cid: [String, Number],
 })
+//事件
+const emit = defineEmits(['change'])
 //变量
 const useAppState = useAppStore()
 const userInfo = ref(useAppState.getUserInfo)
@@ -164,8 +166,10 @@ const getTableData = async () => {
 
 //选择
 const currentId = ref(null)
+const rowItem = ref({})
 const rowSelect = (row) => {
     currentId.value = row.id
+    rowItem.value = row
 }
 
 //取消选择
@@ -176,6 +180,7 @@ const rowCancel = () => {
 //确认关联取样材料
 const linkSamplingClick = () => {
     curId.value = currentId.value
+    emit('change', rowItem.value)
     linkSamplingClose()
 }
 

+ 4 - 3
src/views/tentative/material/sampling.vue

@@ -823,15 +823,16 @@ const editHtmlId = ref('')
 const entrustId = ref('')
 const delegateContractChange = async () => {
     delegateHtmlLoading.value = true
-    await getDelegateDataInfo(entrustId.value)
+    await getDelegateDataInfo()
     await getDelegateExcelHtml()
     delegateHtmlLoading.value = false
 }
 
 //获取委托数据
-const getDelegateDataInfo = async (editId) => {
+const getDelegateDataInfo = async () => {
     const { error, code, msg, data } = await samplingApi.getBussDataInfoTrialEntrust({
-        id: editId ?? null,
+        id: entrustId.value,
+        sampleId: editHtmlId.value,
         pkeyId: nodeErTreeId.value,
         contractId: delegateContractId.value,
     })