浏览代码

确认审批修改

duy 1 年之前
父节点
当前提交
76992cabed

+ 3 - 2
src/api/modules/tasks/data.js

@@ -66,10 +66,11 @@ export default {
         }, msg)
     },
     //批量页详情
+    //获取档案审批任务对应业务数据的pdf信息
     async queryTaskInfo(form, msg = true) {
         return httpApi({
-            url: '/api/blade-business/task/batch-approval-parameter',
-            method: 'get',
+            url: '/api/blade-business/task/getArchiveFileTaskPdfs',
+            method: 'post',
             params: form,
         }, msg)
     },

+ 14 - 9
src/views/tasks/components/TableCard.vue

@@ -195,7 +195,7 @@ const queryTaskStatus = async () => {
 const ContractIdChange = () => {
     searchForm.value.batchValue = null
     queryBatchList()
-    queryUserStartFlow()
+    // queryUserStartFlow()
     getTableData()
 }
 
@@ -248,7 +248,12 @@ const searchClick = () => {
 
 //分页被点击
 const pageChange = ({ current, size }) => {
-    searchForm.value.current = current
+        if (current > 0) {
+            searchForm.value.current = current
+        } else {
+            searchForm.value.current = 1
+        }
+   
     searchForm.value.size = size
     getTableData()
 }
@@ -257,14 +262,14 @@ const pageChange = ({ current, size }) => {
 const tableLoading = ref(false)
 const tableListColumn = ref([
     { key: 'taskName', name: '任务名称' },
-    { key: 'typeValue', name: '任务类型', width: '120' },
-    { key: 'taskStatus', name: '任务状态', width: '160' },
+    { key: 'taskTypeName', name: '任务类型', width: '120' },
+    { key: 'taskStatusName', name: '任务状态', width: '160' },
     { key: 'startTime', name: '开始时间', width: '180' },
     { key: 'endTime', name: '限定时间', width: '180' },
-    { key: 'taskContent', name: '任务描述' },
-    { key: 'reportUserName', name: '上报人', width: '120' },
-    { key: 'waitingUserList', name: '签字人员' },
-    { key: 'evisaContent', name: '电签状态' },
+    { key: 'taskDesc', name: '任务描述' },
+    { key: 'taskReportUserName', name: '上报人', width: '120' },
+    { key: 'taskApproveUserNames', name: '签字人员' },
+    { key: 'evisaStatus', name: '电签状态' },
 ])
 const tableListData = ref([])
 const getTableData = () => {
@@ -289,7 +294,7 @@ const queryPage = async () => {
         ...searchForm.value,
       
         // projectId: projectId.value,
-        contractIdValue:currentContractId.value,
+
     })
     //处理数据
     tableLoading.value = false

+ 81 - 0
src/views/tasks/components/hc-pdf1.vue

@@ -0,0 +1,81 @@
+<template>
+    <div class="hc-page-box">
+        <HcCard title="测试">
+            <div v-loading="loading" element-loading-text="加载文件并初始渲染中..." class="h-full">
+                <div id="pdfView" class="h-full" />
+            </div>
+        </HcCard>
+    </div>
+</template>
+
+<script setup>
+import { onMounted, ref, watch } from 'vue'
+import HcPdfSign from '~src/plugins/HcPdfSign'
+import userApi from '~api/userInfo/index'
+
+//参数
+const props = defineProps({
+    src: {
+        type: [String, Number],
+        default: '',
+    },
+
+})
+//事件
+const emit = defineEmits(['change'])
+const pdf = ref(props.src)
+const loading = ref(true)
+//监听
+watch(() => [
+    props.src,
+], ([src]) => {
+    pdf.value = src
+    getPdf()
+
+  
+    
+})
+
+
+//获取用户签字体
+const logoName = ref('')
+//获取用户信息
+const queryCurrentUserData = async () => {
+    const { error, code, data } = await userApi.queryCurrentUserData()
+    if (!error && code === 200) {
+        logoName.value = data?.signatureUrl
+    } else {
+        logoName.value = ''
+    }
+}
+
+const getPdf = ()=>{
+     //创建PDF签章控件以及相关功能
+     HcPdfSign.createPdf({
+        ele: 'pdfView', //挂载元素的id
+        url: pdf.value, //pdf的url地址
+        img: logoName.value, //签章图片的url地址
+        //加载完成
+        load: () => {
+            loading.value = false
+        },
+        //签章数据改变
+        change: (data) => {
+            console.log(data, '签章数据')
+        
+        
+            // emit('change', data)
+        },
+    })
+
+    //批量签章
+    HcPdfSign.setBatchSign(true)
+}
+
+
+onMounted(()=> {
+    queryCurrentUserData().then(()=>{
+        getPdf()
+    })
+})
+</script>

+ 41 - 51
src/views/tasks/hc-data.vue

@@ -47,7 +47,7 @@
             </template>
             <div class="hc-card-body-flex">
                 <div v-if="batchPdfUrl" class="flex-iframe">
-                    <hc-pdf :src="batchPdfUrl" />
+                    <HcPdf :src="batchPdfUrl" @change="changeSealStrategy" />
                 </div>
                 <div v-else class="flex-iframe hc-no-table-form">
                     <div class="table-form-no">
@@ -150,6 +150,7 @@ import tasksFlowApi from '~api/tasks/flow'
 import { arrToKey, getArrValue, isString } from 'js-fast-way'
 import tasksApi from '~api/tasks/data'
 import dayjs from 'dayjs'
+import HcPdf from './components/hc-pdf1.vue'
 
 //初始变量
 const router = useRouter()
@@ -164,6 +165,7 @@ const activeName = routerQuery?.active || 'key1'
 const projectId = ref(useAppState.getProjectId)
 const contractId = ref(useAppState.getContractId)
 const projectInfo = ref(useAppState.getProjectInfo)
+const sealStrategy = ref([])//签章数据列表
 
 //渲染完成
 onMounted(() => {
@@ -210,21 +212,16 @@ const taskReviewColumns = ref([
 ])
 //任务审核
 const rowTaskName = async (row) => {
-    if (row.formDataId) {
+    if (row.id) {
         taskReviewInfo.value = row
-        const { error, code, data } = await tasksApi.queryApprovalParameter({
-            parallelProcessInstanceId: row['parallelProcessInstanceId'],
-            formDataId: row.formDataId,
-            approvalType: row.approvalType,
+        const { error, code, data } = await tasksApi.queryTaskInfo({
+                taskIds:row.id,
         })
         if (!error && code === 200) {
-            const approvalFileList = getArrValue(data['approvalFileList'])
-            if (approvalFileList.length > 0 && approvalFileList[approvalFileList.length - 1].fileName === '') {
-                approvalFileList.pop()
-            }
+            const approvalFileList = getArrValue(data)
             taskReviewData.value = approvalFileList
             if (approvalFileList.length > 0) {
-                batchPdfUrl.value = approvalFileList[0].fileUrl
+                batchPdfUrl.value = approvalFileList[0].pdfUrl
             }
             taskReviewType.value = '1'
             showTaskReviewModal.value = true
@@ -245,14 +242,14 @@ const checkedRowsColumns = ref([
     { key: 'taskName', name: '任务名称' },
 ])
 const checkedRowsRef = ref([])
-
+ const taskId = ref([])
 const batchApprovalTaskClick = (rows) => {
     taskReviewType.value = '2'
     showTaskReviewModal.value = true
     checkedRowsRef.value = rows
     let taskids = []
     rows.forEach((item) => {
-        taskids.push(item.formDataId)
+        taskids.push(item.id)
     })
     taskids = taskids.join()
     queryTaskInfo(rows[0], taskids)
@@ -262,7 +259,7 @@ const batchApprovalTaskClick = (rows) => {
 const rowTaskReviewClick = async ({ row }) => {
     const type = taskReviewType.value
     if (type === '1') {
-        batchPdfUrl.value = row.fileUrl
+        batchPdfUrl.value = row.pdfUrl
     } else if (row['hc_batchPdfUrl']) {
         batchPdfUrl.value = row['hc_batchPdfUrl']
     } else {
@@ -272,65 +269,58 @@ const rowTaskReviewClick = async ({ row }) => {
 
 //获取PDF数据
 const queryTaskInfo = async (row, taskids) => {
+    taskId.value = taskids && taskids.length > 0 ? taskids : row['id']
     const { error, code, data } = await tasksApi.queryTaskInfo({
-        // formDataId: row['formDataId'] || '',
-        formDataId: taskids && taskids.length > 0 ? taskids : row['formDataId'],
-        approvalType: row['approvalType'],
+        taskIds: taskids && taskids.length > 0 ? taskids : row['id'],
+      
     })
     //处理数据
     if (!error && code === 200) {
-        // const approvalFileList = getArrValue(data['approvalFileList'])
-        // if (approvalFileList.length > 0) {
-        //     batchPdfUrl.value = approvalFileList[0].fileUrl
-        //     row['hc_batchPdfUrl'] = approvalFileList[0].fileUrl
-        // } else {
-        //     batchPdfUrl.value = ''
-        //     row['hc_batchPdfUrl'] = ''
-        //     window?.$message?.warning('PDF获取异常')
-        // }
         const alldata = getArrValue(data)
-        let approvalFileList = []
-        alldata.forEach((item) => {
-            let innerfilist = item?.approvalFileList
-            innerfilist.forEach((item1) => {
-                approvalFileList.push(item1)
-            })
-        })
+        let approvalFileList = alldata
         if (approvalFileList.length > 0) {
-            batchPdfUrl.value = approvalFileList[0].fileUrl
-            row['hc_batchPdfUrl'] = approvalFileList[0].fileUrl
+            batchPdfUrl.value = approvalFileList[0].pdfUrl
+            row['pdfUrl'] = approvalFileList[0].pdfUrl
         } else {
             batchPdfUrl.value = ''
-            row['hc_batchPdfUrl'] = ''
+            row['pdfUrl'] = ''
             window?.$message?.warning('PDF获取异常')
         }
     } else {
         batchPdfUrl.value = ''
-        row['hc_batchPdfUrl'] = ''
+        row['pdfUrl'] = ''
         window?.$message?.warning(data.msg || 'PDF异常')
     }
 }
+const changeSealStrategy = (val)=>{
+    sealStrategy.value = val
 
+    console.log( sealStrategy.value, ' sealStrategy.value')
+    
+}
 //确认审批
 const ConfirmApprovalClick = async () => {
     const formData = taskReviewForm.value
     if (formData.flag === 'NO' && !formData.comment) {
         window?.$message?.warning('请先输入审核意见')
     } else {
-        SMSAuthLoading.value = true
-        const { error, code, msg, data } = await tasksFlowApi.checkTaskUserCertificateInfo({}, false)
-        //判断数据
-        SMSAuthLoading.value = false
-        if (!error && code === 200 && data === true) {
-            const ShowAuth = isCheckSmsCodeTime()
-            SMSAuthShow.value = ShowAuth
-            //免短信验证
-            if (!ShowAuth) {
-                SMSAuthConfirm()
-            }
-        } else {
-            window.$message?.warning(msg)
-        }
+       
+        formData.taskId = taskId.value
+        console.log(formData, 'formData')
+        // SMSAuthLoading.value = true
+        // const { error, code, msg, data } = await tasksApi.batchApproval({}, false)
+        // //判断数据
+        // SMSAuthLoading.value = false
+        // if (!error && code === 200 && data === true) {
+        //     const ShowAuth = isCheckSmsCodeTime()
+        //     SMSAuthShow.value = ShowAuth
+        //     //免短信验证
+        //     if (!ShowAuth) {
+        //         SMSAuthConfirm()
+        //     }
+        // } else {
+        //     window.$message?.warning(msg)
+        // }
     }
 }