duy před 1 rokem
rodič
revize
ade13ee4db

+ 17 - 1
src/views/archives/bookmark.vue

@@ -22,7 +22,7 @@
                     <el-col :span="12">
                         <el-form-item label="保管期限">
                             <el-select v-model="formInline.value.storageTime" placeholder="请选择" clearable style="width:100%">
-                                <el-option v-for="item in retentionPeriod" :key="item.value" :label="item.label" :value="item.value" />
+                                <el-option v-for="item in retentionPeriod" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
                             </el-select>
                         </el-form-item>
                     </el-col>
@@ -90,6 +90,8 @@ import { useAppStore } from '~src/store'
 import { archiveTreeUpdate } from '~api/other'
 import { getStoreValue, setStoreValue } from '~src/utils/storage'
 import HcTree from '~src/components/tree/hc-tree.vue'
+import tasksApi from '~api/tasks/data'
+import { getArrValue } from 'js-fast-way'
 
 //变量
 const useAppState = useAppStore()
@@ -112,6 +114,7 @@ watch(() => [
 //渲染完成
 onMounted(() => {
     setElTreeMenu(1)
+    getStoragePeriod()
 })
 
 //树加载
@@ -132,6 +135,19 @@ const retentionPeriod = ref([
     { label: '10年', value: '3' },
 ])
 
+//获取保管期限
+
+const getStoragePeriod = async () => {
+    const { error, code, data } = await tasksApi.queryTaskTypeStatus({
+        typeOrStatus: 'storage_period',
+    })
+    //处理数据
+    if (!error && code === 200) {
+        retentionPeriod.value = getArrValue(data)
+    } else {
+        retentionPeriod.value = []
+    }
+}
 const coilsize = ref([
     { label: '30mm', value: '30' },
     { label: '40mm', value: '40' },

+ 106 - 42
src/views/transfer/components/table-classify.vue

@@ -13,10 +13,14 @@
                 <span>历史整改报告</span>
             </el-button>
             <HcTooltip keys="file_collection_btn_upload_scanned_files">
-                <el-button type="primary" hc-btn>
+                <el-button v-if="!showBtn" type="primary" hc-btn @click="reportModalClick">
                     <HcIcon name="git-pull-request" />
                     <span>申请验收</span>
                 </el-button>
+                <el-button v-else type="primary" hc-btn @click="cancelClick">
+                    <HcIcon name="git-pull-request" />
+                    <span>撤回验收申请</span>
+                </el-button>
             </HcTooltip>
         </template>
         <HcTable
@@ -28,11 +32,30 @@
             <HcPages :pages="searchForm" @change="pageChange" />
         </template>
     </hc-new-card>
+    <!-- 批量上报审批 -->
+    <HcReportModal
+        title="申请验收"
+        widths="1080px"
+        url="archivesauto/saveApply"
+        :show="showReportModal"
+        :project-id="projectId"
+        :contract-id="contractId"
+        :task-name="reportTaskName"
+        :ids="reportIds"
+        is-datas
+        :datas="reportDatas"
+        @hide="showReportModal = false"
+        @finish="showReportFinish"
+        @tagClose="reportTaskTagClose"
+    />
 </template>
 
 <script setup>
 import { nextTick, onMounted, ref, watch } from 'vue'
-import { getArrValue } from 'js-fast-way'
+import { getArrValue, getObjValue } from 'js-fast-way'
+import { rowsToId } from '~uti/tools'
+import tuningApi from '~api/archiveConfig/tuning.js'
+import initialgApi from '~api/initial/initial'
 
 //参数
 const props = defineProps({
@@ -60,23 +83,18 @@ watch(() => [
     props.treeData,
 ], ([treeData]) => {
     nodeData.value = treeData
+    searchForm.value.nodeIds = treeData.id || ''
+    console.log(treeData, 'treeData')
+    getTableData()
 })
 
 //渲染完成
 onMounted(() => {
-
+    getTableData()
 })
 
-//tab数据和相关处理
-const tabKey = ref('tab2')
-const tabData = ref([
-    // { key:'tab1', name: '全部汇总' },
-    { key:'tab2', name: '历史验收报告' },
-    { key:'tab3', name: '历史整改报告' },
-])
-const tabChange = (item) => {
-    tabKey.value = item?.key
-}
+
+
 
 //搜索表单
 const searchForm = ref({
@@ -93,39 +111,30 @@ const pageChange = ({ current, size }) => {
 //表头
 const tableRef = ref(null)
 const tableColumn = ref([
-    { key:'key1', name: '档号', width: 200 },
-    { key:'key2', name: '案卷题名' },
-    { key:'key3', name: '保管期限', width: 140 },
-    { key:'key4', name: '总页数', width: 140 },
-])
-const tableData = ref([
-    {
-        id: 1,
-        key1: 'FJZB-02-123',
-        key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
-        key3: '永久',
-        key4: '293',
-    },
-    {
-        id: 2,
-        key1: 'FJZB-02-123',
-        key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
-        key3: '永久',
-        key4: '293',
-    },
-    {
-        id: 2,
-        key1: 'FJZB-02-123',
-        key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
-        key3: '永久',
-        key4: '293',
-    },
+    { key:'fileNumber', name: '档号', width: 200 },
+    { key:'name', name: '案卷题名' },
+    { key:'storageTimeValue', name: '保管期限', width: 140 },
+    { key:'pageN', name: '总页数', width: 140 },
 ])
-
+const tableData = ref([])
 //获取数据
 const tableLoading = ref(false)
 const getTableData = async () => {
-
+    tableLoading.value = true
+    const { error, code, data } = await tuningApi.pageByArchive({
+        ...searchForm.value,
+        projectId: projectId.value,
+        contractId: contractId.value,
+        isArchive :1,
+    })
+    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
+    }
 }
 
 //多选
@@ -133,6 +142,61 @@ const tableKeys = ref([])
 const tableSelection = (rows) => {
     tableKeys.value = rows
 }
+const reportIds = ref('')
+const reportTaskName = ref('')
+const reportDatas = ref([])
+const showReportModal = ref(false)
+const reportLoading = ref(false)
+const reportModalClick = async () => {
+    const rows = tableKeys.value
+    console.log(rows, 'rows验收申请行')
+    if (rows.length > 0) {
+        //初始ID
+        const row = getObjValue(rows[0])
+        reportIds.value = rowsToId(rows)
+        //设置任务数据
+        let reportDataArr = []
+        rows.forEach(item => {
+            reportDataArr.push({
+                id: item?.id,
+                name: item?.name,
+            })
+        })
+        reportDatas.value = reportDataArr
+        //设置任务名称
+        reportTaskName.value = rows.length > 1 ? `${row.name}等${rows.length}个文件` : row.name
+        reportLoading.value = false
+        showReportModal.value = true
+    } else {
+        window.$message?.warning('请先勾选需要申请验收的数据')
+    }
+}
+//上报完成
+const showReportFinish = async () => {
+    showReportModal.value = false
+    tableKeys.value = []
+    await getBtnstatus()
+    getTableData()
+}
+//上报的审批内容移除
+const reportTaskTagClose = (index) => {
+    const row = tableKeys.value[index]
+    tableRef.value?.toggleRowSelection(row, false)
+}
+//查看验收申请状态
+const showBtn = ref(true)
+const getBtnstatus = async ()=>{
+    const { error, code, data } = await initialgApi.getApplyStatus({
+        projectId: projectId.value,
+    })
+    if (!error && code === 200) {
+        console.log(data, 'data')
+        showBtn.value = data
+    } else {
+        showBtn.value = true
+     
+    }
+}
 </script>
 
 <style lang="scss" scoped>

+ 7 - 4
src/views/transfer/components/table-collect.vue

@@ -26,7 +26,7 @@
             <div v-for="(item) in totalData" :key="item.unitInfo">
                 <div class="hc-card-table-title">{{ item.unitInfo }}</div>
                 <template v-for="(item1) in item.nodeLists" :key="item1.nodeInfo">
-                    <HcCardItem v-if="item1.list !== null" ui="h-half">
+                    <HcCardItem v-if="item1.list.length > 0" ui="h-half">
                         <template #header>
                             <span>{{ item1.nodeInfo }}</span>
                             <!-- <span class="text-gray">(238卷)</span> -->
@@ -182,11 +182,14 @@ const reportModalClick = async () => {
         window.$message?.warning('请先勾选需要申请验收的数据')
     }
 }
-
+const visuatable = ref(null)
 //上报的审批内容移除
 const reportTaskTagClose = (index) => {
-    //const row = tableCheckedKeys.value[index];
-    //tableListRef.value?.toggleRowSelection(row,false)
+    // const row = tableKeys.value[index]
+    tableKeys.value.splice(index, 1)
+
+    // // tableRef.value?.toggleRowSelection(row, false)
+    // console.log(visuatable.value[index], '1111')
 }
 
 //上报完成

+ 5 - 6
src/views/transfer/initial-expert.vue

@@ -37,7 +37,7 @@
                 <div v-for="(item, index) in totalData" :key="index">
                     <div class="hc-card-table-title">{{ item?.unitInfo }}</div>
                     <template v-for="(item1, index1) in item?.nodeLists" :key="index1">
-                        <HcCardItem v-if="item1.list !== null" ui="h-half">
+                        <HcCardItem v-if="item1.list.length > 0" ui="h-half">
                             <template #header>
                                 <span>{{ item1.nodeInfo }}</span>
                             <!-- <span class="text-gray">(238卷)</span> -->
@@ -91,7 +91,7 @@ import { onMounted, ref } from 'vue'
 import { useRouter } from 'vue-router'
 import { useAppStore } from '~src/store'
 import initialgApi from '~api/initial/initial'
-import { getArrValue, getObjValue } from 'js-fast-way'
+import { getArrValue, getObjValue, isObjNull } from 'js-fast-way'
 import visualTable from './components/visual-table.vue'
 //变量
 const router = useRouter()
@@ -133,14 +133,13 @@ const getTotalData = async ()=>{
     })
     totalLoaing.value = false
     if (!error && code === 200) {
-        console.log(data, 'data')
-        if (data !== null) {
-            totalData.value = [data]
+        if (!isObjNull(data)) {
+            totalData.value = [ data]
         } else {
             totalData.value = []
         }
         
-        console.log(totalData.value, 'totalData.value')
+     
     } else {
         totalData.value = []
      

+ 1 - 0
src/views/transfer/initial.vue

@@ -79,6 +79,7 @@ const sbTableClick = (key) => {
 const nodeDataInfo = ref({})
 const projectTreeClick = ({ data }) => {
     console.log(data)
+    nodeDataInfo.value = data
 }