ZaiZai 2 жил өмнө
parent
commit
5ba68110a5

+ 18 - 0
src/api/modules/other.js

@@ -55,3 +55,21 @@ export const getDapSiteData = (form, msg = true) => httpApi({
     params: form
 }, msg);
 
+
+//检查当前合同段是否开启电签
+export const eVisaTaskCheck = (form, msg = true) => httpApi({
+    url: '/api/blade-business/eVisaTaskCheck/checkContractIsOpenEVisa',
+    method: 'get',
+    params: form
+}, msg);
+
+export const eVisaTaskCheckApi = async (form) => {
+    const {error, code, msg, data} = await eVisaTaskCheck(form)
+    //判断数据
+    if (!error && code === 200 && data === true) {
+        return true
+    } else {
+        window.$message?.warning(msg)
+        return false
+    }
+}

+ 19 - 9
src/views/data-fill/query.vue

@@ -44,7 +44,7 @@
             <HcCard :scrollbar="false" actionSize="lg">
                 <template #header>
                     <HcTooltip keys="query_report">
-                        <el-button type="primary" hc-btn :disabled="tableCheckedKeys.length <= 0" @click="reportModalClick">
+                        <el-button type="primary" hc-btn :disabled="tableCheckedKeys.length <= 0" :loading="reportLoading" @click="reportModalClick">
                             <HcIcon name="send-plane-2"/>
                             <span>上报</span>
                         </el-button>
@@ -158,6 +158,7 @@ import HcTreeData from "./components/HcTreeData.vue"
 import {getStoreData, setStoreData} from '~src/utils/storage'
 import {isType, downloadBlob} from "vue-utils-plus"
 import queryApi from '~api/data-fill/query';
+import {eVisaTaskCheckApi} from "~api/other"
 
 //变量
 const useAppState = useAppStore()
@@ -397,7 +398,8 @@ const reportIds = ref('')
 const reportTaskName = ref('')
 const reportAddition = ref({})
 const showReportModal = ref(false)
-const reportModalClick = () => {
+const reportLoading = ref(false)
+const reportModalClick = async () => {
     const rows = tableCheckedKeys.value;
     //判断是否满足条件
     const result = rows.every(({status})=> {
@@ -405,13 +407,21 @@ const reportModalClick = () => {
     })
     //判断状态
     if (result) {
-        //const info = nodeDataInfo.value;
-        const row = getObjValue(rows[0])
-        reportIds.value = rowsToId(rows)
-        //设置任务名称
-        reportTaskName.value = rows.length > 1 ? `${row.name}等${rows.length}个文件` : row.name
-        //reportAddition.value = {contractIdRelation: info['contractIdRelation']}
-        showReportModal.value = true
+        reportLoading.value = true
+        const taskCheck = await eVisaTaskCheckApi({
+            projectId: projectId.value,
+            contractId: contractId.value
+        })
+        reportLoading.value = false
+        if (taskCheck) {
+            //const info = nodeDataInfo.value;
+            const row = getObjValue(rows[0])
+            reportIds.value = rowsToId(rows)
+            //设置任务名称
+            reportTaskName.value = rows.length > 1 ? `${row.name}等${rows.length}个文件` : row.name
+            //reportAddition.value = {contractIdRelation: info['contractIdRelation']}
+            showReportModal.value = true
+        }
     } else {
         window.$message?.warning('已上报的文件不能进行再次上报,若要重新上报,要先撤回之前的上报,再重新上报')
     }

+ 25 - 16
src/views/data-fill/wbs.vue

@@ -51,7 +51,7 @@
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="wbs_report" v-if="NodeStatus !== '3'">
-                        <el-button hc-btn :disabled="NodeStatus === '3' || NodeStatus === '1'" @click="reportModalClick">
+                        <el-button hc-btn :disabled="NodeStatus === '3' || NodeStatus === '1'" :loading="reportLoading" @click="reportModalClick">
                             <HcIcon name="send-plane-2"/>
                             <span>上报</span>
                         </el-button>
@@ -154,7 +154,7 @@
                             </el-button>
                         </HcTooltip>
                         <HcTooltip keys="wbs_report" v-if="NodeStatus !== '3'">
-                            <el-button hc-btn :disabled="NodeStatus === '3' || NodeStatus === '1'" @click="reportModalClick">
+                            <el-button hc-btn :disabled="NodeStatus === '3' || NodeStatus === '1'" :loading="reportLoading" @click="reportModalClick">
                                 <HcIcon name="send-plane-2"/>
                                 <span>上报</span>
                             </el-button>
@@ -329,8 +329,8 @@ import HcTreeData from "./components/HcTreeData.vue"
 import WbsTree from "./components/WbsTree.vue"
 import {getTokenHeader} from '~src/api/request/header';
 import {getStoreData, setStoreData} from '~src/utils/storage'
-import {isType, deepClone, formValidate, clog} from "vue-utils-plus"
-import {getDictionary} from "~api/other"
+import {isType, deepClone, formValidate} from "vue-utils-plus"
+import {getDictionary, eVisaTaskCheckApi} from "~api/other"
 import wbsApi from "~api/data-fill/wbs"
 import Draggable from "vuedraggable";
 
@@ -1068,23 +1068,32 @@ const reportIds = ref('')
 const reportTaskName = ref('')
 const reportAddition = ref({})
 const showReportModal = ref(false)
+const reportLoading = ref(false)
 const reportModalClick = async () => {
     const info = nodeDataInfo.value;
     const rows = ListItemDatas.value;
     if (rows.length > 0) {
-        //初始弹出弹窗,防呆
-        reportIds.value = info['primaryKeyId']
-        reportAddition.value = {
-            classify: authBtnTabKey.value,
-            contractIdRelation: info['contractIdRelation'],
-        }
-        showReportModal.value = true
-        //请求文件题名
-        const {data} = await wbsApi.queryDocumentTitle({
-            primaryKeyId: info['primaryKeyId'],
-            classify: authBtnTabKey.value
+        reportLoading.value = true
+        const taskCheck = await eVisaTaskCheckApi({
+            projectId: projectId.value,
+            contractId: contractId.value
         })
-        reportTaskName.value = isString(data)? data : ''
+        reportLoading.value = false
+        if (taskCheck) {
+            //初始弹出弹窗,防呆
+            reportIds.value = info['primaryKeyId']
+            reportAddition.value = {
+                classify: authBtnTabKey.value,
+                contractIdRelation: info['contractIdRelation'],
+            }
+            showReportModal.value = true
+            //请求文件题名
+            const {data} = await wbsApi.queryDocumentTitle({
+                primaryKeyId: info['primaryKeyId'],
+                classify: authBtnTabKey.value
+            })
+            reportTaskName.value = isString(data)? data : ''
+        }
     } else {
         window.$message?.warning('暂无相关数据')
     }

+ 17 - 7
src/views/ledger/components/table-list.vue

@@ -19,7 +19,7 @@
             </template>
             <template #extra>
                 <HcTooltip keys="ledger_query_report">
-                    <el-button hc-btn type="primary" :disabled="tableCheckedKeys.length <= 0" @click="reportModalClick">
+                    <el-button hc-btn type="primary" :disabled="tableCheckedKeys.length <= 0" :loading="reportLoading" @click="reportModalClick">
                         <HcIcon name="send-plane-2"/>
                         <span>批量上报</span>
                     </el-button>
@@ -67,6 +67,7 @@
 <script setup>
 import {ref, watch, nextTick} from "vue";
 import queryApi from '~api/ledger/query';
+import {eVisaTaskCheckApi} from "~api/other"
 import {getArrValue, getObjValue, isString} from "vue-utils-plus"
 
 //参数
@@ -191,10 +192,11 @@ const tableSelectionChange = (rows) => {
 }
 
 //批量上报
-const showReportModal = ref(false)
 const reportIds = ref('')
 const reportTaskName = ref('')
-const reportModalClick = () => {
+const reportLoading = ref(false)
+const showReportModal = ref(false)
+const reportModalClick = async () => {
     const rows = tableCheckedKeys.value;
     //判断是否满足条件
     const result = rows.every(({status})=> {
@@ -202,10 +204,18 @@ const reportModalClick = () => {
     })
     //判断状态
     if (result) {
-        const row = getObjValue(rows[0])
-        reportIds.value = rowsToId(rows)
-        reportTaskName.value = rows.length > 1 ? `${row.name}等${rows.length}个文件` : row.name
-        showReportModal.value = true
+        reportLoading.value = true
+        const taskCheck = await eVisaTaskCheckApi({
+            projectId: projectId.value,
+            contractId: contractId.value
+        })
+        reportLoading.value = false
+        if (taskCheck) {
+            const row = getObjValue(rows[0])
+            reportIds.value = rowsToId(rows)
+            reportTaskName.value = rows.length > 1 ? `${row.name}等${rows.length}个文件` : row.name
+            showReportModal.value = true
+        }
     } else {
         window.$message?.warning('已上报的文件不能进行再次上报,若要重新上报,要先撤回之前的上报,再重新上报')
     }

+ 15 - 5
src/views/other-file/project-scanning.vue

@@ -34,7 +34,7 @@
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="project-scanning-report">
-                        <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="reportModalClick">
+                        <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" :loading="reportLoading" @click="reportModalClick">
                             <HcIcon name="send-plane-2"/>
                             <span>批量上报</span>
                         </el-button>
@@ -220,6 +220,7 @@ import {getStoreData, setStoreData} from '~src/utils/storage'
 import projectScanningApi from "~api/other-file/projectScanning";
 import {downloadBlob, getArrValue, deepClone} from "vue-utils-plus"
 import notableform from '~src/assets/view/notableform.svg';
+import {eVisaTaskCheckApi} from "~api/other"
 import tasksDataApi from '~api/tasks/data';
 import ossApi from "~api/oss";
 import dayjs from "dayjs"
@@ -691,15 +692,24 @@ const batchDownload = async () => {
 const reportIds = ref('')
 const reportTaskName = ref('')
 const showReportModal = ref(false)
-const reportModalClick = () => {
+const reportLoading = ref(false)
+const reportModalClick = async () => {
     const rows = tableCheckedKeys.value;
     const result = rows.every(({status})=> {
         return status === 0 //isApproval !== 1 && status !== 0 || isApproval === 1 && status !== 0
     })
     if (result) {
-        reportIds.value = rowsToId(rows)
-        reportTaskName.value = rows.length > 1?`${rows[0].fileName}等${rows.length}个文件`:rows[0].fileName
-        showReportModal.value = true
+        reportLoading.value = true
+        const taskCheck = await eVisaTaskCheckApi({
+            projectId: projectId.value,
+            contractId: contractId.value
+        })
+        reportLoading.value = false
+        if (taskCheck) {
+            reportIds.value = rowsToId(rows)
+            reportTaskName.value = rows.length > 1?`${rows[0].fileName}等${rows.length}个文件`:rows[0].fileName
+            showReportModal.value = true
+        }
     } else {
         window.$message?.warning('已上报的文件不能进行再次上报,若要重新上报,要先撤回之前的上报,再重新上报')
     }

+ 20 - 11
src/views/other/first-item.vue

@@ -141,7 +141,7 @@
                     <HcIcon name="eye"/>
                     <span>预览</span>
                 </el-button>
-                <el-button hc-btn :disabled="!contractId || !isTableForm" @click="reportModalClick">
+                <el-button hc-btn :disabled="!contractId || !isTableForm" :loading="reportLoading" @click="reportModalClick">
                     <HcIcon name="send-plane-2"/>
                     <span>上报</span>
                 </el-button>
@@ -165,7 +165,7 @@ import {useRouter, useRoute} from 'vue-router'
 import WbsTree from "./components/WbsTree.vue"
 import HcUpload from "./components/HcUpload.vue"
 import HTableForm from "~src/plugins/HTableForm"
-import {getReportNumber} from "~api/other";
+import {getReportNumber,eVisaTaskCheckApi} from "~api/other";
 import firstApi from '~api/other/first-item';
 import tasksApi from '~api/tasks/data';
 import {getStoreData, setStoreData} from '~src/utils/storage'
@@ -548,19 +548,28 @@ const reportIds = ref('')
 const showReportModal = ref(false)
 const reportTaskName = ref('')
 const reportAddition = ref({})
-const reportModalClick = () => {
+const reportLoading = ref(false)
+const reportModalClick = async () => {
     const { primaryKeyId, contractIdRelation } = treeItem.value
     const rows = tableFileData.value
     if (rows.length > 0) {
-        reportIds.value = rowsToId(rows)
-        reportTaskName.value = rows.length > 1?`${rows[0].name}等${rows.length}个文件`:rows[0].name
-        reportAddition.value = {
-            classify: 1,
-            isFirst: 1,
-            primaryKeyId: primaryKeyId,
-            contractIdRelation: contractIdRelation ?? contractId.value,
+        reportLoading.value = true
+        const taskCheck = await eVisaTaskCheckApi({
+            projectId: projectId.value,
+            contractId: contractId.value
+        })
+        reportLoading.value = false
+        if (taskCheck) {
+            reportIds.value = rowsToId(rows)
+            reportTaskName.value = rows.length > 1?`${rows[0].name}等${rows.length}个文件`:rows[0].name
+            reportAddition.value = {
+                classify: 1,
+                isFirst: 1,
+                primaryKeyId: primaryKeyId,
+                contractIdRelation: contractIdRelation ?? contractId.value,
+            }
+            showReportModal.value = true
         }
-        showReportModal.value = true
     } else {
         window.$message?.warning('暂无相关数据')
     }