duy 1 год назад
Родитель
Сommit
8171c2ea5e

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

@@ -57,4 +57,44 @@ export default {
             data: form,
         }, msg)
      },
+    //档案在线验收-我验收的案卷
+    async getlazyTree(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-manager/archiveTreeContract/lazyTree',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
+    //档案在线验收-查询节点已经上报的档案
+     async getNodeArchives(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archivesauto/getNodeArchives',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
+    //在线验收-抽检统计
+      async userInspectStats(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archivesauto/userInspectStats',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
+      //在线验收-修改抽检状态
+      async updateInspectStatus(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archivesauto/updateInspectStatus',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
+    //在线验收-保存抽检意见
+    async saveInspect(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archivesauto/saveInspect',
+            method: 'post',
+            data: form,
+        }, msg)
+     },
 }

+ 133 - 57
src/components/tree/hc-tree.vue

@@ -59,6 +59,7 @@ import { getArrValue, getObjValue, isArrItem, isNullES } from 'js-fast-way'
 import EditNodeDialog from '~src/components/dialog/EditNodeDialog.vue'
 import SortNodeDialog from '~src/components/dialog/SortNodeDialog.vue'
 import { delMessageV2 } from '~com/message/index.js'
+import initialgApi from '~api/initial/initial'
 
 //参数
 const props = defineProps({
@@ -112,6 +113,10 @@ const props = defineProps({
         type:Boolean,
         default:true, //是否显示默认菜单
     },
+    isOwn:{
+        type:Boolean,
+        default:false,
+    },
 
 })
 
@@ -133,6 +138,7 @@ const projectId = ref(props.projectId)
 const contractId = ref(props.contractId)
 const idPrefix = ref(props.idPrefix)
 const radioKeys = ref(Number(props.radioKey))
+const isOwn = ref(props.isOwn)
 
 //监听
 watch(() => [
@@ -143,8 +149,9 @@ watch(() => [
     props.contractId,
     props.idPrefix,
     props.radioKey,
+    props.isOwn,
 
-], ([menus, AutoKeys, expandKeys, UserProjectId, UserContractId, UserIdPrefix, radioKey]) => {
+], ([menus, AutoKeys, expandKeys, UserProjectId, UserContractId, UserIdPrefix, radioKey, own]) => {
     menusData.value = menus
     isAutoKeys.value = AutoKeys
     TreeExpandKey.value = expandKeys
@@ -152,6 +159,7 @@ watch(() => [
     contractId.value = UserContractId
     idPrefix.value = UserIdPrefix
     radioKeys.value = Number(radioKey)
+    isOwn.value = own
 })
 
 //单选框事件
@@ -162,69 +170,137 @@ const treeRadioChange = (val) => {
 //树形结构异步加载数据
 const defaultExpandedCids = ref([])
 const ElTreeLoadNode = async (node, resolve) => {
-    let parentId = 0
-    if (node.level !== 0) {
-        const nodeData = getObjValue(node?.data)
-        parentId = nodeData?.id || ''
-    }
-    //获取数据
-    const { error, code, data } = await getArchiveTreeLazyTree({
-        parentId,
-        projectId:projectId.value,
-        contractId:contractId.value,
-    })
-    //处理数据
-    if (!error && code === 200) {
-        let clickKey = '', defaultExpandedArr = []
-        const keys = TreeExpandKey.value || []
-        let resData = getArrValue(data)
-
-        //如果是加载第一层,而且返回为空,先初始化树
-        if (parentId === 0 && resData.length === 0) {
-            const { error:error2, code:code2, data:data2 } = await initTree({
-                projectId:projectId.value,
-            })
-            if (!error2 && code2 === 200) {
-                resData = getArrValue(data2)
+  console.log(isOwn.value, 'isOwn.value')
+    if (isOwn.value) {
+        let parentId = 0
+        if (node.level !== 0) {
+            const nodeData = getObjValue(node?.data)
+            parentId = nodeData?.id || ''
+        }
+        //获取数据
+        const { error, code, data } = await initialgApi.getlazyTree({
+            parentId,
+            projectId:projectId.value,
+            // contractId:contractId.value,
+        })
+        //处理数据
+        if (!error && code === 200) {
+            let clickKey = '', defaultExpandedArr = []
+            const keys = TreeExpandKey.value || []
+            let resData = getArrValue(data)
+
+            //如果是加载第一层,而且返回为空,先初始化树
+            // if (parentId === 0 && resData.length === 0) {
+            //     const { error:error2, code:code2, data:data2 } = await initTree({
+            //         projectId:projectId.value,
+            //     })
+            //     if (!error2 && code2 === 200) {
+            //         resData = getArrValue(data2)
+            //     }
+            // }
+
+            for (let i = 0; i < resData.length; i++) {
+                const item = resData[i]
+                resData[i].isLeaf = !item.hasChildren
+            }
+            if (keys.length > 0) {
+                let lastKey = keys[keys.length - 1]
+                for (const item of resData) {
+                    //自动展开
+                    if (isArrItem(keys, item?.id)) {
+                        defaultExpandedArr.push(item?.id)
+                    }
+                    //最后一个,选中点击
+                    if (item?.id === lastKey) {
+                        clickKey = item?.id
+                    }
+                }
+            } else if (node.level === 0) {
+                defaultExpandedArr.push(resData[0]?.id)
+            }
+            //自动展开
+            defaultExpandedCids.value = defaultExpandedArr
+            if (node.level === 0) {
+                emit('nodeLoading')
+            }
+            resolve(resData)
+            //最后一个,执行点击
+            if (props.isAutoClick && clickKey) {
+                await nextTick(() => {
+                    document.getElementById(`${idPrefix.value}${clickKey}`)?.click()
+                })
             }
+        } else {
+            if (node.level === 0) {
+                emit('nodeLoading')
+            }
+            resolve([])
         }
-
-        for (let i = 0; i < resData.length; i++) {
-            const item = resData[i]
-            resData[i].isLeaf = !item.hasChildren
+    } else {
+        let parentId = 0
+        if (node.level !== 0) {
+            const nodeData = getObjValue(node?.data)
+            parentId = nodeData?.id || ''
         }
-        if (keys.length > 0) {
-            let lastKey = keys[keys.length - 1]
-            for (const item of resData) {
-                //自动展开
-                if (isArrItem(keys, item?.id)) {
-                    defaultExpandedArr.push(item?.id)
+        //获取数据
+        const { error, code, data } = await getArchiveTreeLazyTree({
+            parentId,
+            projectId:projectId.value,
+            contractId:contractId.value,
+        })
+        //处理数据
+        if (!error && code === 200) {
+            let clickKey = '', defaultExpandedArr = []
+            const keys = TreeExpandKey.value || []
+            let resData = getArrValue(data)
+
+            //如果是加载第一层,而且返回为空,先初始化树
+            if (parentId === 0 && resData.length === 0) {
+                const { error:error2, code:code2, data:data2 } = await initTree({
+                    projectId:projectId.value,
+                })
+                if (!error2 && code2 === 200) {
+                    resData = getArrValue(data2)
                 }
-                //最后一个,选中点击
-                if (item?.id === lastKey) {
-                    clickKey = item?.id
+            }
+
+            for (let i = 0; i < resData.length; i++) {
+                const item = resData[i]
+                resData[i].isLeaf = !item.hasChildren
+            }
+            if (keys.length > 0) {
+                let lastKey = keys[keys.length - 1]
+                for (const item of resData) {
+                    //自动展开
+                    if (isArrItem(keys, item?.id)) {
+                        defaultExpandedArr.push(item?.id)
+                    }
+                    //最后一个,选中点击
+                    if (item?.id === lastKey) {
+                        clickKey = item?.id
+                    }
                 }
+            } else if (node.level === 0) {
+                defaultExpandedArr.push(resData[0]?.id)
             }
-        } else if (node.level === 0) {
-            defaultExpandedArr.push(resData[0]?.id)
-        }
-        //自动展开
-        defaultExpandedCids.value = defaultExpandedArr
-        if (node.level === 0) {
-            emit('nodeLoading')
-        }
-        resolve(resData)
-        //最后一个,执行点击
-        if (props.isAutoClick && clickKey) {
-            await nextTick(() => {
-                document.getElementById(`${idPrefix.value}${clickKey}`)?.click()
-            })
-        }
-    } else {
-        if (node.level === 0) {
-            emit('nodeLoading')
+            //自动展开
+            defaultExpandedCids.value = defaultExpandedArr
+            if (node.level === 0) {
+                emit('nodeLoading')
+            }
+            resolve(resData)
+            //最后一个,执行点击
+            if (props.isAutoClick && clickKey) {
+                await nextTick(() => {
+                    document.getElementById(`${idPrefix.value}${clickKey}`)?.click()
+                })
+            }
+        } else {
+            if (node.level === 0) {
+                emit('nodeLoading')
+            }
+            resolve([])
         }
-        resolve([])
     }
 }
 

+ 1 - 1
src/config/index.json

@@ -1,6 +1,6 @@
 {
     "version": "202304141558",
-    "target": "http://192.168.0.109:8090",
+    "target": "http://192.168.0.128:8090",
     "smsPhone": "",
     "vite": {
         "port": 5175,

+ 1 - 1
src/styles/app/theme.scss

@@ -281,7 +281,7 @@ html.dark {
         background: transparent;
     }
     .hc-card-item-box {
-        background: transparent;
+        background: transparent !important;
     }
     .hc-submit-report-target.el-overlay {
         background-color: #030C3B;

+ 3 - 0
src/styles/page/transfer/inspects.scss

@@ -23,3 +23,6 @@
         margin-left: 50px;
     }
 }
+
+
+

+ 2 - 2
src/views/archives/components/meta-table.vue

@@ -48,8 +48,8 @@ const props = defineProps({
         default: true, 
     },
     metaDataTable:{
-        type: [Array],
-        default: [],
+        type: Array,
+        default: () => ([]),
     },
  
 })

+ 208 - 31
src/views/transfer/components/carry-spot-checks.vue

@@ -5,9 +5,7 @@
             uis="hc-carry-spot-checks-target" @close="onCarrySpotChecksDrawerClose"
         >
             <div class="hc-carry-spot-checks-pdf">
-                <HcPdf
-                    src="https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20221212/ce9799c7d18efc03efefd6f242439f2e.pdf"
-                />
+                <HcPdf v-loading="pdfLoading" :src="pdfUrl" />
                 <el-tooltip :disabled="!isBubble" content="展开/收起 右侧目录" placement="top">
                     <div class="hc-csc-pdf-btn" @click="onCarryDataShow">
                         <HcIcon v-show="isCarryDataShow" name="arrow-right-s" />
@@ -27,7 +25,7 @@
                         <div class="hc-info-text-item">
                             <div class="title">案卷题名:</div>
                             <div class="content">
-                                安康至来凤国家高速公路奉节至巫山(渝鄂界)段干岩洞隧道LK3+425~LK3+393初期支护钢筋网分项开工报告、检验申请批复单、质量检验报告单、记录表、试验检测记录及评定报告、中间交工证书
+                                {{ fileInfo.name }}
                             </div>
                         </div>
                         <div class="hc-info-text-item">
@@ -35,23 +33,26 @@
                                 <span>密</span>
                                 <span class="ml-7">级:</span>
                             </div>
-                            <div class="content">机密</div>
+                            <div class="content">  {{ fileInfo.secretLevelValue }}</div>
                         </div>
                         <div class="hc-info-text-item">
                             <div class="title">保管期限:</div>
-                            <div class="content">永久</div>
+                            <div class="content"> {{ fileInfo.storageTimeValue }}</div>
                         </div>
                         <div class="hc-info-text-item">
                             <div class="title">卷内文件:</div>
-                            <div class="content">9</div>
+                            <div class="content"> {{ fileInfo.pageNumber }}</div>
                         </div>
                         <div class="hc-info-text-item">
                             <div class="title">起止日期:</div>
-                            <div class="content">2022.02.12~2023.11.02</div>
+                            <div v-if="fileInfo?.endDate !== '' || fileInfo?.startDate !== null" class="content">
+                                {{ `${splitDate(fileInfo?.startDate)}~${splitDate(fileInfo?.endDate)}` }}
+                            </div>
+                            <div v-else class="content" />
                         </div>
                         <div class="hc-info-text-item">
                             <div class="title">立卷单位:</div>
-                            <div class="content">贵州路桥集团xxxxx</div>
+                            <div class="content">  {{ fileInfo.unit }}</div>
                         </div>
                     </el-scrollbar>
                 </div>
@@ -61,7 +62,7 @@
                         :is-index="false" :loading="cscTableLoading" is-new :index-style="{ width: 60 }"
                     >
                         <template #name="{ row }">
-                            <div :class="row.id === 2 ? 'text-link' : 'text-hover'">{{ row?.name }}</div>
+                            <div :class="row.id === checkId ? 'text-link' : 'text-hover'" @click="changePdf(row)">{{ row?.fileName }}</div>
                         </template>
                     </HcTable>
 
@@ -95,7 +96,7 @@
                         </template>
                     </HcTable>
 
-                    <MetaTable v-if="tabTypeKey === 'tab5'" :loading="cscTableLoading" />
+                    <MetaTable v-if="tabTypeKey === 'tab5'" :loading="cscmetaTableLoading" :meta-data-table="cscmetaDataTabledata" :ishow-file="ishowFile" />
 
                     <HcTable
                         v-if="tabTypeKey === 'tab6'" :column="cscTableColumn5" :datas="cscTableData5"
@@ -112,7 +113,7 @@
                         </div>
                     </el-tooltip>
                 </div>
-                <div class="hc-csc-action-box">
+                <div v-if="checkId" class="hc-csc-action-box">
                     <div class="header-box">
                         <div class="title">抽检意见:</div>
                         <div class="extra">
@@ -120,18 +121,19 @@
                         </div>
                     </div>
                     <div class="textarea-box">
-                        <el-input
-                            v-model="reform.content" :autosize="{ minRows: 5 }" placeholder="请填写抽检意见"
-                            resize="none"
-                            type="textarea"
-                        />
+                        <div v-if="ishowAllopinion">
+                            <el-input v-model="reform.content" type="textarea" :autosize="{ minRows: 5 }" resize="none" placeholder="请填写抽检意见" @focus="contentClick" />
+                        </div>
+                        <div v-else>
+                            <el-input ref="saveTagInput" v-model="reform.myOpinion" type="textarea" :autosize="{ minRows: 5 }" resize="none" placeholder="请填写抽检意见" />
+                        </div>
                     </div>
                     <div class="btn-box">
                         <el-button hc-btn @click="onCarrySpotChecksDrawerClose">
                             <HcIcon name="close" />
                             <span>{{ closeText }}</span>
                         </el-button>
-                        <el-button hc-btn type="primary" @click="checkClick">
+                        <el-button hc-btn type="primary" :loading="submitLoading" @click="submitOpinion">
                             <HcIcon name="check" />
                             <span>{{ checkText }}</span>
                         </el-button>
@@ -142,7 +144,7 @@
 
         <!-- 使用弹窗查看数据 -->
         <hc-new-dialog v-model="cscTableDataModal" :footer="false" :title="cscTableDataTitle" is-table widths="1080px" @close="cscTableDataModalClose">
-            <MetaTable v-if="tabTypeKey === 'tab5'" :loading="cscTableLoading" />
+            <MetaTable v-if="tabTypeKey === 'tab5'" :loading="cscmetaTableLoading" :meta-data-table="cscmetaDataTabledata" :ishow-file="ishowFile" />
             <HcTable
                 v-if="tabTypeKey === 'tab6'" :column="cscTableColumn51" :datas="cscTableData5"
                 :loading="cscTableLoading" is-new :index-style="{ width: 60 }"
@@ -152,9 +154,13 @@
 </template>
 
 <script setup>
-import { ref, watch } from 'vue'
+import { nextTick, onActivated, onMounted, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
 import MetaTable from './meta-table.vue'
+import archiveQueryApi from '~api/using/query.js'
+import { getArrValue, getObjValue } from 'js-fast-way'
+import tuningApi from '~api/archiveConfig/tuning.js'
+import initialgApi from '~api/initial/initial'
 
 //参数
 const props = defineProps({
@@ -178,6 +184,14 @@ const props = defineProps({
         type: [String, Number],
         default: '保存抽检意见',
     },
+    fileId:{
+        type: [String, Number],
+        default: '', //案卷ID
+    },
+    fileInfo:{
+        type: Object,
+        default: () => ({}),
+    },
 })
 
 //事件
@@ -191,17 +205,44 @@ const contractId = ref(props.contractId)
 const nodeData = ref(props.treeData)
 const isBubble = ref(useAppState.getBubble)
 const isDrawer = ref(props.show)
+const fileId = ref(props.fileId)//案卷ID
+const fileInfo = ref(props.fileInfo)//案卷ID
+const userInfo = ref(useAppState.getUserInfo)
 
 //监听
 watch(() => [
     props.show,
     useAppState.getBubble,
-], ([show, bubble]) => {
+    props.fileId,
+    props.fileInfo,
+], ([show, bubble, FileId, FileInfo]) => {
+  
     isDrawer.value = show
     isBubble.value = bubble
+    fileId.value = FileId
+    fileInfo.value = FileInfo
+    console.log( fileInfo.value, ' fileInfo.value1111')
+    if (fileId.value) {
+        getArchiveFileListData()
+        let url
+        viewPdf(fileId.value).then((res)=>{
+            console.log(res, 'res')
+            url = res
+            pdfUrl.value = url
+            if (pdfUrl.value && pdfUrl?.value.length > 0 ) {
+                    setTimeout(() => {
+                        serReviewFile()
+                    }, 30000)
+                }
+        })
+     
+    }
 })
 
-
+onMounted(()=>{
+    console.log(fileId.value, 'fileId.value')
+   
+})
 //类型tab数据和相关处理
 const tabTypeKey = ref('tab1')
 const tabTypeTab = ref([
@@ -222,16 +263,102 @@ const cscTableLoading = ref(false)
 const cscTableColumn1 = [
     { key: 'name', name: '卷内文件题名', align: 'center' },
 ]
-const cscTableData1 = ref([
-    // {id: 1, name: '[K8+450阳光大桥第x联(跨)墩顶负弯矩张拉压浆].PDF'},
-    // {id: 2, name: '[K8+450阳光大桥第x联(跨)墩顶负弯矩张拉压浆].PDF'},
-    // {id: 3, name: '[K8+450阳光大桥第x联(跨)墩顶负弯矩张拉压浆].PDF'},
-    // {id: 4, name: '[K8+450阳光大桥第x联(跨)墩顶负弯矩张拉压浆].PDF'},
-    // {id: 5, name: '[K8+450阳光大桥第x联(跨)墩顶负弯矩张拉压浆].PDF'},
-    // {id: 6, name: '[K8+450阳光大桥第x联(跨)墩顶负弯矩张拉压浆].PDF'},
-    // {id: 7, name: '[K8+450阳光大桥第x联(跨)墩顶负弯矩张拉压浆].PDF'}
-])
+const cscTableData1 = ref([])
+//获取卷内文件数据
+
+const getArchiveFileListData = async ()=>{
+    const { error, code, msg, data } = await archiveQueryApi.getArchiveFileList({
+        id: fileId.value, //案卷id
+
+    })
+    //处理返回数据
+    if (!error && code === 200) {
+        fileInfo.value.pageNumber = data.pageNumber
+
+        cscTableData1.value = getArrValue(data['approvalFileList'])
+        if (cscTableData1.value.length > 0) {
+            checkmetaFileId.value = cscTableData1.value[0].id
+            getmetaInfo()
+        }
+
+    } else {
+
+        cscTableData1.value = []
+    }
+}
+const ishowFile = ref(false)
+const pdfLoading = ref(false)
+const pdfUrl = ref('')
+const checkId = ref('')
+const checkmetaFileId = ref('')
+const ishowAllopinion = ref(false)
+const saveTagInput = ref(null)
+const contentClick = ()=>{
+    console.log(11111)
+    ishowAllopinion.value = false
+    nextTick(()=>{
+        saveTagInput.value?.focus()
+    })
+}
+const changePdf = (row)=>{
+    console.log(row, 'row')
+    ishowFile.value = true
+    pdfLoading.value = false
+    pdfUrl.value = row['pdfFileUrl'] || ''
+    checkId.value = row.id
+    checkmetaFileId.value = row.id
+    getmetaInfo()
+    ishowAllopinion.value = true
+
+    getopiniondata()
+    if (pdfUrl.value && pdfUrl?.value.length > 0) {
+            setTimeout(() => {
+                 serReviewFile()
+            }, 300000)
+     }
+
 
+}
+//设置为已查阅
+const serReviewFile = async ()=>{
+            const { error, code, data, msg } = await initialgApi.updateInspectStatus({
+                archiveId: fileInfo.value.id,
+                projectId:projectId.value,
+            })
+}
+const opid = ref('')
+
+//获取抽检意见
+const getopiniondata = async ()=>{
+    const { error, code, data, msg } = await initialgApi.getOpinion({
+        fileId: checkId.value,
+    })
+    if (!error && code === 200) {
+        console.log(data, 'data')
+        let opiniondata = getObjValue(data)
+        reform.value.content = opiniondata?.allOpinion
+        reform.value.type = opiniondata?.allOpinion?.length > 0 ? true : false
+        reform.value.myOpinion = opiniondata?.opinion
+        opid.value = opiniondata?.id
+    }
+}
+//获取元数据信息
+//获取元数据
+const cscmetaTableLoading = ref(false)
+const cscmetaDataTabledata = ref([])
+const getmetaInfo = async (fileId)=>{
+
+    cscmetaTableLoading.value = true
+    const { error, code, data } = await tuningApi.getMetadataFileByid({
+        fileId: checkmetaFileId.value,
+    })
+    cscmetaTableLoading.value = false
+    if (!error && code === 200) {
+        cscmetaDataTabledata.value = getArrValue(data)
+    } else {
+        cscmetaDataTabledata.value = []
+    }
+}
 //竣工资料
 const cscTableColumn2 = [
     { key: 'name', name: '竣工图资料', align: 'center' },
@@ -359,12 +486,62 @@ const cscTableDataModalClose = () => {
 //关闭抽查
 const onCarrySpotChecksDrawerClose = () => {
     isDrawer.value = false
+    ishowFile.value = false
+    checkmetaFileId.value = ''
+    checkId.value = ''
     emit('close', false)
 }
 
 const checkClick = () => {
     emit('check')
 }
+const submitLoading = ref(false)
+const submitOpinion = async ()=>{
+    submitLoading.value = true
+    const { error, code, data, msg } = await initialgApi.saveInspect({
+        fileId: checkId.value,
+        archiveId:fileInfo.value.id,
+        // opinion:reform.value.content,
+        opinion:reform.value.myOpinion,
+        projectId:projectId.value,
+        userId:userInfo.value.user_id,
+        archiveName:fileInfo.value.name,
+        id:  opid.value || null,
+
+    })
+    submitLoading.value = false
+    if (!error && code === 200) {
+        window.$message.success(msg)
+        serReviewFile()
+      
+
+    }
+    // addOpinion
+}
+//截取日期
+const splitDate = (val)=>{
+    if (val) {
+        return val?.substring(0, 10)
+    } else {
+        return ''
+    }
+}
+//查阅案卷pdf
+const viewPdf = async (id) => {
+    window.$message?.info('预览案卷需要合并pdf,需要一点时间')
+    pdfLoading.value = true
+    const { error, code, data, msg } = await tuningApi.printArchive({
+        id: id,
+    })
+    pdfLoading.value = false
+    if (!error && code === 200) {
+        if (data) {
+            return data
+        } else {
+            window.$message?.warning('文件不存在')
+        }
+    }
+}
 </script>
 
 <style lang="scss" scoped>

+ 1 - 0
src/views/transfer/components/meta-table.vue

@@ -77,6 +77,7 @@ watch(() => [
     props.metaDataTable,
 ], ([loading, ishowFile, metaDataTable]) => {
     console.log(metaDataTable, 'metaDataTable')
+    console.log(ishowFile, 'ishowFile')
     isLoading.value = loading
     console.log(ishowFile, 'ishowFile')
     iShowFile.value = ishowFile

+ 75 - 62
src/views/transfer/preliminary-examination.vue

@@ -13,9 +13,14 @@
             <div class="hc-tree-new-switch">
                 <HcNewSwitch :datas="tabData" :keys="tabKey" size="small" :round="false" @change="tabChange" />
             </div>
-            <div v-loading="treeLoading" class="hc-tree-box" element-loading-text="加载中...">
+            <div v-if="tabKey === 'tab1'" v-loading="treeLoading" class="hc-tree-box" element-loading-text="加载中...">
                 <el-scrollbar>
-                    <HcTree :contract-id="contractId" :project-id="projectId" @nodeTap="projectTreeClick" @nodeLoading="treeNodeLoading" />
+                    <HcTree :contract-id="contractId" :project-id="projectId" :is-own="false" @nodeTap="projectTreeClick" @nodeLoading="treeNodeLoading" />
+                </el-scrollbar>
+            </div>
+            <div v-else v-loading="treeLoading" element-loading-text="加载中..." class="hc-tree-box">
+                <el-scrollbar>
+                    <HcTree :contract-id="contractId" :project-id="projectId" :is-own="true" @nodeTap="projectTreeClick" @nodeLoading="treeNodeLoading" />
                 </el-scrollbar>
             </div>
             <!-- 左右拖动 -->
@@ -26,11 +31,11 @@
                 <template #header>
                     <HcIcon name="volume-up" />
                     <span class="ml-2">您本次验收抽检案卷共</span>
-                    <span class="text-orange mx-2">1232</span>
+                    <span class="text-orange mx-2">{{ stats?.total }}</span>
                     <span>卷,目前已抽检</span>
-                    <span class="text-green mx-2">82</span>
+                    <span class="text-green mx-2">{{ stats?.reviewed }}</span>
                     <span>卷,抽检率为</span>
-                    <span class="text-blue mx-2">7.6%</span>
+                    <span class="text-blue mx-2">{{ stats?.ratio }}</span>
                 </template>
                 <template #extra>
                     <el-button hc-btn type="primary" @click="writingConclusion">编写结论</el-button>
@@ -39,15 +44,16 @@
                 <div class="hc-card-diy-search-box">
                     <div class="text-gray text-sm mr-4 hc-card-diy-tip-view">
                         <span class="mr-4">通过关键词、题名、桩号等相关信息进行搜索:</span>
-                        <el-checkbox-group v-model="checkList">
-                            <el-checkbox label="案卷" />
-                            <el-checkbox label="文件" />
-                        </el-checkbox-group>
+                        <el-radio-group v-model="checkList" class="ml-4" @change="getTableData">
+                            <el-radio label="1" size="large">案卷</el-radio>
+                            <el-radio label="2" size="large">文件</el-radio>
+                        </el-radio-group>
                     </div>
                     <div class="autocomplete-box">
-                        <el-autocomplete
-                            v-model="state1" :fetch-suggestions="querySearch" class="w-full" clearable
-                            placeholder="搜索" @select="handleSelect"
+                        <el-input
+                            v-model="state1" class="w-full" clearable
+                            placeholder="搜索" 
+                            @change="getTableData"
                         />
                         <el-button class="ml-10" type="primary" @click="logShowClick">抽检记录</el-button>
                     </div>
@@ -77,7 +83,7 @@
 
         <!-- 展开抽查 -->
         <CarrySpotChecks
-            :show="isCarrySpotChecksDrawer" close-text="关闭案卷" check-text="保存并继续抽检" @check="onCarrySpotChecksClose"
+            :show="isCarrySpotChecksDrawer" close-text="关闭案卷" check-text="保存并继续抽检" :file-id="fileId" :file-info="fileInfo" @check="onCarrySpotChecksClose"
             @close="onCarrySpotChecksClose"
         />
 
@@ -98,6 +104,8 @@ import { useRouter } from 'vue-router'
 import HcTree from '~src/components/tree/hc-tree.vue'
 import CarrySpotChecks from './components/carry-spot-checks.vue'
 import TableOpinion from './components/examination/table-opinion.vue'
+import initialgApi from '~api/initial/initial'
+import { getArrValue, getObjValue } from 'js-fast-way'
 
 //变量
 const router = useRouter()
@@ -140,62 +148,30 @@ const tabChange = (item) => {
 
 
 //项目树被点击
-const projectTreeClick = () => {
-
+const projectTreeClick = ({ data }) => {
+    console.log(data, 'data')
+    searchForm.value.nodeId = data.id
+    getTableData()
+    getUserInspectStats()
 }
 
-const checkList = ref([])
+const checkList = ref('1')
 
 const state1 = ref('')
-const restaurants = ref([
-    { value: '重庆市水利局关于安康至来凤国家高速公路奉节至巫山(渝鄂界)段水土保持方案准予许可的决定.PDF' },
-    { value: '水土保持方案报告书、水土保持方案报告书技术评审会议纪要、水土保持方案的批复' },
-])
-const querySearch = (queryString, cb) => {
-    const results = queryString ? restaurants.value.filter(createFilter(queryString)) : restaurants.value
-    cb(results)
-}
-const createFilter = (queryString) => {
-    return (restaurant) => {
-        return (
-            restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
-        )
-    }
-}
-const handleSelect = (item) => {
-    console.log(item)
-}
+
+
+
+
 
 const tableColumn = ref([
-    { key: 'key1', name: '档号', width: 180 },
-    { key: 'key2', name: '案卷题名' },
-    { key: 'key3', name: '立卷单位' },
-    { key: 'key4', name: '抽检状态' },
-    { key: 'key5', name: '抽检意见' },
+    { key: 'fileNumber', name: '档号', width: 180 },
+    { key: 'name', name: '案卷题名' },
+    { key: 'unit', name: '立卷单位' },
+    { key: 'inspectStatusName', name: '抽检状态' },
+    { key: 'updateStatusName', name: '抽检意见' },
     { key: 'action', name: '操作', width: 100 },
 ])
-const tableData = ref([
-    {
-        id: 1,
-        key1: 'xxxx',
-        key2: '安康至来凤国家高速公路奉节至巫山(渝鄂界)段水土保持方案准予许可的决定',
-        key3: 'xxxxxxx',
-        key4: '已抽检',
-        key4_1: '1',
-        key5: '合格',
-        key5_1: '1',
-    },
-    {
-        id: 2,
-        key1: 'xxxx',
-        key2: '安康至来凤国家高速公路奉节至巫山(渝鄂界)段水土保持方案准予许可的决定',
-        key3: 'xxxxxxx',
-        key4: '未抽检',
-        key4_1: '2',
-        key5: '整改',
-        key5_1: '2',
-    },
-])
+const tableData = ref([])
 
 //获取数据
 const tableLoading = ref(false)
@@ -211,13 +187,50 @@ const pageChange = ({ current, size }) => {
 }
 
 const getTableData = async () => {
+    if (searchForm.value.nodeId) {
+        tableLoading.value = true
+        const { error, code, data } = await initialgApi.getNodeArchives({
+            ...searchForm.value,
+            projectId: projectId.value,
+        type:tabKey.value === 'tab1' ? 1 : 2,
+        searchValue:state1.value,
+        searchType:checkList.value,
+        })
+        tableLoading.value = false
+        if (!error && code === 200) {
+            tableData.value = getArrValue(data['records'])
+            searchForm.value.total = data['total'] || 0
+        } else {
+            tableData.value = []
+            searchForm.value.total = 0
+        }
+    } else {
+        window.$message.warning('请先选择左侧节点')
+    }
 
 }
-
+//获取抽检统计
+const stats = ref({})
+const getUserInspectStats = async ()=>{
+    const { error, code, data } = await initialgApi.userInspectStats({
+            projectId: projectId.value,
+    })
+        if (!error && code === 200) {
+         console.log(data, 'DATA')
+         stats.value = getObjValue(data)
+        } else {
+            stats.value = {}
+        }
+}
 
 const isCarrySpotChecksDrawer = ref(false)
+const fileId = ref('')//案卷ID
+const fileInfo = ref({})//案卷信息
 const tableClick = (row) => {
     isCarrySpotChecksDrawer.value = true
+    fileId.value = row.id
+    fileInfo.value = row
+    console.log( fileInfo.value, '  fileInfo.value')
 }
 
 //关闭抽查