|
@@ -48,9 +48,7 @@
|
|
|
<div class="hc-card-body-flex">
|
|
|
<div v-if="batchPdfUrl" class="flex-iframe">
|
|
|
<!-- <HcPdf :src="batchPdfUrl" @change="changeSealStrategy" /> -->
|
|
|
- <KeepAlive>
|
|
|
- <component :is="current" :id="getUUID()" :src="batchPdfUrl" @change="changeSealStrategy" />
|
|
|
- </KeepAlive>
|
|
|
+ <HcPdf v-if="pdfItem.pdfUrl" :sign="logoName" :src="pdfItem.pdfUrl" :dom="pdfItem.hcSignImageArr" :is-batch="isBatch" @change="pdfChange" />
|
|
|
</div>
|
|
|
<div v-else class="flex-iframe hc-no-table-form">
|
|
|
<div class="table-form-no">
|
|
@@ -65,6 +63,9 @@
|
|
|
<HcTable :column="taskReviewColumns" :datas="taskReviewData" @row-click="rowTaskReviewClick" />
|
|
|
</div>
|
|
|
<div v-if="taskReviewType === '2'" class="data-table checkedRowsRef">
|
|
|
+ <el-button :loading="isBatchLoaing" hc-btn type="primary" @click="clickBatch">
|
|
|
+ 批量电签
|
|
|
+ </el-button>
|
|
|
<HcTable :column="checkedRowsColumns" :datas="checkedRowsRef" @row-click="rowTaskReviewClick" />
|
|
|
</div>
|
|
|
<div v-if="sbTableKey === 'key1'" class="radio-group-box">
|
|
@@ -143,7 +144,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onMounted, ref, shallowRef } from 'vue'
|
|
|
+import { nextTick, onMounted, ref } from 'vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import TableCard from './components/TableCard.vue'
|
|
@@ -154,6 +155,7 @@ import { arrToKey, getArrValue, getUUID, isString } from 'js-fast-way'
|
|
|
import tasksApi from '~api/tasks/data'
|
|
|
import dayjs from 'dayjs'
|
|
|
import HcPdf from './components/hc-pdf1.vue'
|
|
|
+import userApi from '~api/userInfo/index'
|
|
|
|
|
|
//初始变量
|
|
|
const router = useRouter()
|
|
@@ -177,7 +179,7 @@ onMounted(() => {
|
|
|
})
|
|
|
|
|
|
//pdf
|
|
|
-const current = shallowRef(HcPdf)
|
|
|
+
|
|
|
//合同段信息
|
|
|
const contractList = ref([])
|
|
|
|
|
@@ -216,6 +218,42 @@ const taskReviewForm = ref({ flag: 'OK', comment: '' })
|
|
|
const taskReviewColumns = ref([
|
|
|
{ key: 'fileName', name: '文件名称' },
|
|
|
])
|
|
|
+const pdfItem = ref({})
|
|
|
+const pdfIndex = ref(-1)
|
|
|
+const logoName = ref('')
|
|
|
+//const clickBatch
|
|
|
+const isBatchLoaing = ref(false)
|
|
|
+const isBatch = ref(false)//是否批量电签
|
|
|
+const clickBatch = async ()=>{
|
|
|
+ await queryCurrentUserData()
|
|
|
+ isBatch.value = true
|
|
|
+}
|
|
|
+//获取用户信息
|
|
|
+const queryCurrentUserData = async () => {
|
|
|
+ const { error, code, data } = await userApi.queryCurrentUserData()
|
|
|
+ if (!error && code === 200) {
|
|
|
+ logoName.value = data?.signatureUrl || ''
|
|
|
+ } else {
|
|
|
+ logoName.value = ''
|
|
|
+ }
|
|
|
+}
|
|
|
+const pdfDataClick = (item, index) => {
|
|
|
+ pdfItem.value = {}
|
|
|
+ pdfIndex.value = index
|
|
|
+ nextTick(() => {
|
|
|
+ pdfItem.value = item
|
|
|
+ })
|
|
|
+}
|
|
|
+//签章数据改变
|
|
|
+const pdfChange = (data) => {
|
|
|
+ // pdfData.value[pdfIndex.value].hcSignImageArr = data
|
|
|
+ checkedRowsRef.value.forEach((ele)=>{
|
|
|
+ if (ele.id === pdfIndex.value) {
|
|
|
+ ele.hcSignImageArr = data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log('签章数据', data)
|
|
|
+}
|
|
|
//任务审核
|
|
|
const rowTaskName = async (row) => {
|
|
|
if (row.id) {
|
|
@@ -231,6 +269,8 @@ const rowTaskName = async (row) => {
|
|
|
}
|
|
|
taskReviewType.value = '1'
|
|
|
showTaskReviewModal.value = true
|
|
|
+
|
|
|
+
|
|
|
} else {
|
|
|
taskReviewData.value = []
|
|
|
batchPdfUrl.value = ''
|
|
@@ -252,6 +292,8 @@ const taskId = ref([])
|
|
|
const batchApprovalTaskClick = (rows) => {
|
|
|
taskReviewType.value = '2'
|
|
|
showTaskReviewModal.value = true
|
|
|
+
|
|
|
+
|
|
|
checkedRowsRef.value = rows
|
|
|
let taskids = []
|
|
|
rows.forEach((item) => {
|
|
@@ -271,7 +313,10 @@ const rowTaskReviewClick = async ({ row }) => {
|
|
|
} else {
|
|
|
queryTaskInfo(row)
|
|
|
}
|
|
|
+ pdfDataClick(row, row.id)
|
|
|
}
|
|
|
+//默认点击
|
|
|
+
|
|
|
|
|
|
//获取PDF数据
|
|
|
const queryTaskInfo = async (row, taskids) => {
|
|
@@ -298,35 +343,39 @@ const queryTaskInfo = async (row, taskids) => {
|
|
|
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 {
|
|
|
-
|
|
|
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)
|
|
|
- // }
|
|
|
+ let objarr = []
|
|
|
+ checkedRowsRef.value.forEach((ele)=>{
|
|
|
+ objarr.push({
|
|
|
+ taskId:ele.id,
|
|
|
+ comment:formData.comment,
|
|
|
+ flag:formData.flag,
|
|
|
+ sealStrategy:ele.hcSignImageArr,
|
|
|
+
|
|
|
+ })
|
|
|
+ })
|
|
|
+ console.log(objarr, 'objarr')
|
|
|
+ SMSAuthLoading.value = true
|
|
|
+ const { error, code, msg, data } = await tasksApi.batchApproval({ taskArchiveDtoList:objarr }, false)
|
|
|
+ //判断数据
|
|
|
+ SMSAuthLoading.value = false
|
|
|
+ if (!error && code === 200 && data === true) {
|
|
|
+ const ShowAuth = isCheckSmsCodeTime()
|
|
|
+ SMSAuthShow.value = ShowAuth
|
|
|
+ //免短信验证
|
|
|
+ if (!ShowAuth) {
|
|
|
+ SMSAuthConfirm()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ window.$message?.warning(msg)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|