Browse Source

获取当前期验收ID

duy 1 year ago
parent
commit
609d84737f

+ 8 - 0
src/api/modules/initial/initial.js

@@ -170,4 +170,12 @@ export default {
             params: form,
         }, msg)
     },
+    //在线验收-获取当前期在线验收id
+    async getCurrentId(form, msg = true) {
+        return httpApi({
+            url: '/api//blade-archive/archiveExpertConclusion/getCurrentId',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
 }

+ 11 - 1
src/views/transfer/components/carry-spot-checks.vue

@@ -202,6 +202,10 @@ const props = defineProps({
         type: Boolean,
         default: false,
     },
+    currentId:{
+        type: [String, Number],
+        default: '',
+    },
 })
 
 //事件
@@ -218,6 +222,7 @@ const isDrawer = ref(props.show)
 const fileId = ref(props.fileId)//案卷ID
 const fileInfo = ref(props.fileInfo)//案卷ID
 const userInfo = ref(useAppState.getUserInfo)
+const currentId = ref(props.currentId)
 
 //监听
 watch(() => [
@@ -227,7 +232,8 @@ watch(() => [
     props.fileInfo,
     props.projectId,
     props.isOpinion,
-], ([show, bubble, FileId, FileInfo, ProjectId, isO]) => {
+    props.currentId,
+], ([show, bubble, FileId, FileInfo, ProjectId, isO, curId]) => {
   
     isDrawer.value = show
     isBubble.value = bubble
@@ -235,6 +241,7 @@ watch(() => [
     fileInfo.value = FileInfo
     projectId.value = ProjectId
     isOpinion.value = isO
+    currentId.value = curId
 
     if (fileId.value && isDrawer.value) {
         getArchiveFileListData()
@@ -351,6 +358,7 @@ const serReviewFile = async ()=>{
             const { error, code, data, msg } = await initialgApi.updateInspectStatus({
                 archiveId: fileId.value,
                 projectId:projectId.value,
+                conclusionId:currentId.value,
             })
 }
 const opid = ref('')
@@ -361,6 +369,7 @@ const getopiniondata = async ()=>{
     const { error, code, data, msg } = await initialgApi.getArchiveFileOpinion({
         fileId: checkId.value,
         projectId:projectId.value,
+        conclusionId:currentId.value,
     })
     if (!error && code === 200) {
         console.log(data, 'data')
@@ -537,6 +546,7 @@ const submitOpinion = async ()=>{
         userId:userInfo.value.user_id,
         archiveName:fileInfo.value.name,
         id:  opid.value || null,
+        conclusionId:currentId.value,
 
     })
     submitLoading.value = false

+ 17 - 5
src/views/transfer/preliminary-examination.vue

@@ -84,7 +84,8 @@
 
         <!-- 展开抽查 -->
         <CarrySpotChecks
-            :show="isCarrySpotChecksDrawer" close-text="关闭案卷" check-text="保存抽检意见" :file-id="fileId" :file-info="fileInfo" :project-id="projectId" :is-opinion="isOpinion" @check="onCarrySpotChecksClose"
+            :show="isCarrySpotChecksDrawer" close-text="关闭案卷" check-text="保存抽检意见" :file-id="fileId" :file-info="fileInfo" :project-id="projectId" :is-opinion="isOpinion" :current-id="currentId"
+            @check="onCarrySpotChecksClose"
             @close="onCarrySpotChecksClose"
         />
 
@@ -99,7 +100,7 @@
 </template>
 
 <script setup>
-import { onMounted, ref, watch } from 'vue'
+import { onActivated, onMounted, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
 import { useRouter } from 'vue-router'
 import HcTree from '~src/components/tree/hc-tree.vue'
@@ -127,10 +128,21 @@ watch(() => [
 })
 
 //渲染完成
-onMounted(() => {
-
+onActivated(() => {
+    getCurrentIdData()
 })
-
+//获取获取当前期在线验收id
+const currentId = ref('')
+const getCurrentIdData = async ()=>{
+    const { error, code, data } = await initialgApi.getCurrentId({
+            projectId: projectId.value,
+    })
+        if (!error && code === 200) {
+            currentId.value = data
+        } else {
+            currentId.value = ''
+        }
+}
 //树加载
 const treeLoading = ref(true)
 const treeNodeLoading = () => {