|
@@ -0,0 +1,563 @@
|
|
|
+<template>
|
|
|
+ <div class="hc-layout-box">
|
|
|
+ <HcTabsSimple :no-drop-shadow="showTaskReviewModal" :cur="sbTableKey" :datas="sbTableData" @tab-click="sbTableClick">
|
|
|
+ <template #tab-key1>
|
|
|
+ <TableCard
|
|
|
+ v-if="sbTableKey === 'key1'" :contract-id="contractId"
|
|
|
+ :contract-list="contractList"
|
|
|
+ :project-id="projectId" :table-key="sbTableKey"
|
|
|
+ :select-contrac-id="selectContracId" @batch-approval="batchApprovalTaskClick"
|
|
|
+ @row-task-name="rowTaskName"
|
|
|
+ @sign-rules="setSignRulesClick"
|
|
|
+ @changeselect-contrac-id="changeselectContracId"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template #tab-key2>
|
|
|
+ <TableCard
|
|
|
+ v-if="sbTableKey === 'key2'" :contract-id="contractId"
|
|
|
+ :contract-list="contractList"
|
|
|
+ :project-id="projectId" :table-key="sbTableKey"
|
|
|
+ :select-contrac-id="selectContracId" @batch-approval="batchApprovalTaskClick"
|
|
|
+ @row-task-name="rowTaskName"
|
|
|
+ @sign-rules="setSignRulesClick"
|
|
|
+ @changeselect-contrac-id="changeselectContracId"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template #tab-key3>
|
|
|
+ <TableCard
|
|
|
+ v-if="sbTableKey === 'key3'" :contract-id="contractId"
|
|
|
+ :contract-list="contractList"
|
|
|
+ :project-id="projectId" :table-key="sbTableKey"
|
|
|
+ :select-contrac-id="selectContracId" @batch-approval="batchApprovalTaskClick"
|
|
|
+ @row-task-name="rowTaskName"
|
|
|
+ @sign-rules="setSignRulesClick"
|
|
|
+ @changeselect-contrac-id="changeselectContracId"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </HcTabsSimple>
|
|
|
+
|
|
|
+ <!-- 任务审核 -->
|
|
|
+ <hc-new-dialog v-model="showTaskReviewModal" is-table widths="80vw">
|
|
|
+ <template #header="{ titleId, titleClass }">
|
|
|
+ <div class="hc-card-header flex items-center">
|
|
|
+ <div :id="titleId" :class="titleClass">任务审核 【已开启电签】</div>
|
|
|
+ <div v-if="taskReviewType === '1'" class="text-main ml-6 font-bold">
|
|
|
+ 任务名称:{{ taskReviewInfo.taskName }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="hc-card-body-flex">
|
|
|
+ <div :key="batchPdfUrl" class="flex-iframe">
|
|
|
+ <hc-pdfs v-if="batchPdfUrl" :url="batchPdfUrl" />
|
|
|
+ <div v-else class="hc-no-table-form">
|
|
|
+ <div class="table-form-no">
|
|
|
+ <img :src="notableform" alt="">
|
|
|
+ <div class="desc">暂无 PDF 数据</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div :class="sbTableKey === 'key1' ? '' : 'vh'" class="flex-table">
|
|
|
+ <div v-if="taskReviewType === '1'" class="data-table taskReviewData">
|
|
|
+ <HcTable :column="taskReviewColumns" :datas="taskReviewData" is-new :index-style="{ width: 60 }" @row-click="rowTaskReviewClick" />
|
|
|
+ </div>
|
|
|
+ <div v-if="taskReviewType === '2'" class="data-table checkedRowsRef">
|
|
|
+ <HcTable :column="checkedRowsColumns" :datas="checkedRowsRef" is-new :index-style="{ width: 60 }" @row-click="rowTaskReviewClick" />
|
|
|
+ </div>
|
|
|
+ <div v-if="sbTableKey === 'key1'" class="radio-group-box">
|
|
|
+ <span class="label">审批操作:</span>
|
|
|
+ <el-radio-group v-model="taskReviewForm.flag">
|
|
|
+ <el-radio value="OK">同意</el-radio>
|
|
|
+ <el-radio value="NO">废除任务</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ <div v-if="sbTableKey === 'key1'" class="textarea-box">
|
|
|
+ <el-input
|
|
|
+ v-model="taskReviewForm.comment" :autosize="{ minRows: 3, maxRows: 5 }"
|
|
|
+ placeholder="请输入审核意见"
|
|
|
+ type="textarea"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template v-if="sbTableKey === 'key1'" #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button size="large" @click="showTaskReviewModal = false">取消</el-button>
|
|
|
+ <el-button :loading="SMSAuthLoading" hc-btn type="primary" @click="ConfirmApprovalClick">确认审批</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </hc-new-dialog>
|
|
|
+
|
|
|
+ <!-- 设置重签规则 -->
|
|
|
+ <hc-new-dialog v-model="showSetSignRulesModal" title="设置重签规则" widths="38rem">
|
|
|
+ <div class="mb-10 text-orange">
|
|
|
+ <span
|
|
|
+ class="mr-4"
|
|
|
+ >提示:设置默认时长,在任务被废除需要重签的时候,规定的重签上报时间提示时间段内,系统提示用户重签信息,但是超过处理时间,系统可默认自动授权重签</span>
|
|
|
+ <el-checkbox v-model="setPactVal" label="Option 1" size="large">
|
|
|
+ <span class="text-main">《授权系统自动电签协议》</span>
|
|
|
+ </el-checkbox>
|
|
|
+ </div>
|
|
|
+ <div class="obj-item-cell">
|
|
|
+ <div class="label">默认处理时间(时)</div>
|
|
|
+ <HcCounter v-model="formReport.date" @update:model-value="dateUpdateValue" />
|
|
|
+ </div>
|
|
|
+ <div class="obj-item-cell">
|
|
|
+ <div class="label">开启系统自动电签</div>
|
|
|
+ <el-switch v-model="formReport.active" />
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button size="large" @click="showSetSignRulesModal = false">取消</el-button>
|
|
|
+ <el-button hc-btn type="primary">保存</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </hc-new-dialog>
|
|
|
+
|
|
|
+ <!-- 短信认证还是公章认证 -->
|
|
|
+ <hc-dialog v-model="isSmsAndUKey" title="确认认证方式" widths="26rem" @close="smsAndUKeyCancel">
|
|
|
+ <div class="mb-6px mt-6px line-height-7">请选择认证方式,是个人短信认证,还是公章认证方式进行签字审批。</div>
|
|
|
+ <template #footer>
|
|
|
+ <el-button :loading="smsAuthLoading" hc-btn type="primary" @click="smsAuthClick">个人认证</el-button>
|
|
|
+ <el-button :loading="uKeyAuthLoading" hc-btn type="success" @click="uKeyAuthClick">公章认证</el-button>
|
|
|
+ </template>
|
|
|
+ </hc-dialog>
|
|
|
+
|
|
|
+ <!-- 短信认证 -->
|
|
|
+ <HcSmsAuth :show="SMSAuthShow" :tab-key="smsAuthKey" @cancel="SMSAuthCancel" @confirm="SMSAuthConfirm" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { nextTick, onMounted, ref, watch } from 'vue'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
+import TableCard from './components/TableCard.vue'
|
|
|
+import notableform from '~src/assets/view/notableform.svg'
|
|
|
+import { checkFlowUserIsExistPfxFile, getContractInfo } from '~api/other'
|
|
|
+import { arrToKey, getArrValue, isString } from 'js-fast-way'
|
|
|
+import tasksApi from '~api/tasks/data'
|
|
|
+import dayjs from 'dayjs'
|
|
|
+import website from '~src/config'
|
|
|
+import wbsApi from '~api/data-fill/wbs'
|
|
|
+
|
|
|
+const localModelVal = ref(false)
|
|
|
+//初始变量
|
|
|
+const router = useRouter()
|
|
|
+const useRoutes = useRoute()
|
|
|
+const useAppState = useAppStore()
|
|
|
+
|
|
|
+//路由参数
|
|
|
+const routerQuery = useRoutes?.query
|
|
|
+const activeName = routerQuery?.active || 'key1'
|
|
|
+
|
|
|
+//全局变量
|
|
|
+const projectId = ref(useAppState.getProjectId)
|
|
|
+const contractId = ref(useAppState.getContractId)
|
|
|
+
|
|
|
+//渲染完成
|
|
|
+onMounted(() => {
|
|
|
+
|
|
|
+ checkSmsCode()
|
|
|
+ getContractInfoList()
|
|
|
+ if (!website.localModel) {
|
|
|
+ localModelVal.value = false
|
|
|
+ } else {
|
|
|
+ //甬台温,零号变更按钮禁用
|
|
|
+ localModelVal.value = true
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+//Ukey是否存在
|
|
|
+const isUKey = ref(useAppState.getIsUKey)
|
|
|
+watch(() => useAppState.getIsUKey, (ukey) => {
|
|
|
+ isUKey.value = ukey
|
|
|
+}, { immediate: true, deep: true })
|
|
|
+
|
|
|
+//合同段信息
|
|
|
+const contractList = ref([])
|
|
|
+
|
|
|
+const getContractInfoList = async ()=>{
|
|
|
+ const { error, code, data } = await getContractInfo({
|
|
|
+ pid: projectId.value,
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ contractList.value = getArrValue(data)
|
|
|
+ } else {
|
|
|
+ contractList.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
+//类型处理
|
|
|
+const sbTableKey = ref(activeName)
|
|
|
+const sbTableData = ref([
|
|
|
+ { icon: 'time', label: '待办任务', key: 'key1' },
|
|
|
+ { icon: 'calendar-check', label: '已办任务', key: 'key2' },
|
|
|
+ { icon: 'user-shared', label: '我发起的', key: 'key3' },
|
|
|
+])
|
|
|
+const sbTableClick = (key) => {
|
|
|
+ sbTableKey.value = key
|
|
|
+ router.push({
|
|
|
+ path: useRoutes.path,
|
|
|
+ query: { active: key },
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//审批页详情
|
|
|
+const showTaskReviewModal = ref(false)
|
|
|
+const taskReviewType = ref('1')
|
|
|
+const taskReviewInfo = ref({})
|
|
|
+const taskReviewData = ref([])
|
|
|
+const batchPdfUrl = ref('')
|
|
|
+const taskReviewForm = ref({ flag: 'OK', comment: '' })
|
|
|
+const taskReviewColumns = ref([
|
|
|
+ { key: 'fileName', name: '文件名称' },
|
|
|
+])
|
|
|
+
|
|
|
+//任务审核
|
|
|
+const rowTaskName = async (row) => {
|
|
|
+ if (row.formDataId) {
|
|
|
+ taskReviewInfo.value = row
|
|
|
+ const { error, code, data } = await tasksApi.queryApprovalParameter({
|
|
|
+ parallelProcessInstanceId: row['parallelProcessInstanceId'] || '',
|
|
|
+ formDataId: row.formDataId,
|
|
|
+ approvalType: row.approvalType,
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ const approvalFileList = getArrValue(data['approvalFileList'])
|
|
|
+ if (approvalFileList.length > 0 && approvalFileList[approvalFileList.length - 1].fileName === '') {
|
|
|
+ approvalFileList.pop()
|
|
|
+ }
|
|
|
+ taskReviewData.value = approvalFileList
|
|
|
+ if (approvalFileList.length > 0) {
|
|
|
+
|
|
|
+ const { approvalType } = row
|
|
|
+ if (approvalType === 1) {
|
|
|
+ batchPdfUrl.value = await bussPreview( approvalFileList[0])
|
|
|
+ } else {
|
|
|
+ batchPdfUrl.value = approvalFileList[0].fileUrl
|
|
|
+ }
|
|
|
+ }
|
|
|
+ taskReviewType.value = '1'
|
|
|
+ showTaskReviewModal.value = true
|
|
|
+ } else {
|
|
|
+ taskReviewData.value = []
|
|
|
+ batchPdfUrl.value = ''
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ taskReviewInfo.value = {}
|
|
|
+ taskReviewData.value = []
|
|
|
+ batchPdfUrl.value = ''
|
|
|
+ window?.$message?.warning('此数据异常')
|
|
|
+ }
|
|
|
+}
|
|
|
+//预览pdf
|
|
|
+
|
|
|
+const bussPreview = async (row) => {
|
|
|
+ const { error, code, data } = await wbsApi.getBussPdfs({
|
|
|
+ nodeId: row.nodeld || '',
|
|
|
+ classify: row.classify || '',
|
|
|
+ projectId: row.projectId,
|
|
|
+ contractId:row.contractId
|
|
|
+,
|
|
|
+ })
|
|
|
+
|
|
|
+ row.bussPreviewLoading = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+
|
|
|
+
|
|
|
+ return data
|
|
|
+ } else {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+}
|
|
|
+//批量审批
|
|
|
+const checkedRowsColumns = ref([
|
|
|
+ { key: 'taskName', name: '任务名称' },
|
|
|
+])
|
|
|
+const checkedRowsRef = ref([])
|
|
|
+
|
|
|
+const batchApprovalTaskClick = (rows) => {
|
|
|
+ taskReviewType.value = '2'
|
|
|
+ showTaskReviewModal.value = true
|
|
|
+ checkedRowsRef.value = rows
|
|
|
+ let taskids = []
|
|
|
+ rows.forEach((item) => {
|
|
|
+ taskids.push(item.formDataId)
|
|
|
+ })
|
|
|
+ taskids = taskids.join()
|
|
|
+ queryTaskInfo(rows[0], taskids)
|
|
|
+}
|
|
|
+
|
|
|
+//行被点击
|
|
|
+const rowTaskReviewClick = async ({ row }) => {
|
|
|
+ const { approvalType } = row
|
|
|
+ const type = taskReviewType.value
|
|
|
+ if (approvalType === 1) {
|
|
|
+ if (type !== '1') {
|
|
|
+ await queryTaskInfo(row)
|
|
|
+ } else {
|
|
|
+ batchPdfUrl.value = await bussPreview(row)
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ const newUrl = type === '1' ? row.fileUrl : row['hc_batchPdfUrl']
|
|
|
+
|
|
|
+ if (newUrl) {
|
|
|
+ // 如果有新的URL,直接更新
|
|
|
+ batchPdfUrl.value = newUrl
|
|
|
+ } else if (type !== '1') {
|
|
|
+ // 如果没有缓存的URL且是批量模式,需要获取
|
|
|
+ await queryTaskInfo(row)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//获取PDF数据
|
|
|
+const queryTaskInfo = async (row, taskids) => {
|
|
|
+ console.log(checkedRowsRef.value, 'checkedRowsRef.value')
|
|
|
+ const approvalTypeVal = arrToKey(checkedRowsRef.value, 'approvalType', ',')
|
|
|
+ try {
|
|
|
+ const { error, code, data } = await tasksApi.queryTaskInfo({
|
|
|
+ formDataId: taskids && taskids.length > 0 ? taskids : row['formDataId'],
|
|
|
+ // approvalType: row['approvalType'],
|
|
|
+ approvalType: approvalTypeVal,
|
|
|
+ })
|
|
|
+
|
|
|
+ if (!error && code === 200) {
|
|
|
+ const alldata = getArrValue(data)
|
|
|
+ let approvalFileList = []
|
|
|
+ alldata.forEach((item) => {
|
|
|
+ let innerfilist = item?.approvalFileList
|
|
|
+ if (Array.isArray(innerfilist)) {
|
|
|
+ approvalFileList.push(...innerfilist)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ const { approvalType } = row
|
|
|
+ if (approvalType === 1) {
|
|
|
+ if (approvalFileList.length > 0) {
|
|
|
+
|
|
|
+ const rowPdf = approvalFileList[0]
|
|
|
+ batchPdfUrl.value = await bussPreview(rowPdf)
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (approvalFileList.length > 0) {
|
|
|
+ const url = approvalFileList[0].fileUrl
|
|
|
+ if (url) {
|
|
|
+ batchPdfUrl.value = url
|
|
|
+ row['hc_batchPdfUrl'] = url
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ throw new Error('PDF获取异常')
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+ throw new Error(data?.msg || 'PDF异常')
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ window?.$message?.warning(err.message)
|
|
|
+ batchPdfUrl.value = ''
|
|
|
+ row['hc_batchPdfUrl'] = ''
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//确认审批
|
|
|
+const isSmsAndUKey = ref(false)
|
|
|
+const ConfirmApprovalClick = async () => {
|
|
|
+
|
|
|
+
|
|
|
+ const formData = taskReviewForm.value
|
|
|
+ if (formData.flag === 'NO' && !formData.comment) {
|
|
|
+ window?.$message?.warning('请先输入审核意见')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ SMSAuthLoading.value = true
|
|
|
+ const { error, code, msg, data } = await checkFlowUserIsExistPfxFile({
|
|
|
+ projectId: projectId.value,
|
|
|
+ }, false)
|
|
|
+ if (error || code !== 200 || data !== true) {
|
|
|
+ SMSAuthLoading.value = false
|
|
|
+ window.$message?.warning(msg)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ isSmsAndUKey.value = true
|
|
|
+ SMSAuthLoading.value = false
|
|
|
+}
|
|
|
+
|
|
|
+//个人认证
|
|
|
+const smsAuthKey = ref('1')
|
|
|
+const smsAuthLoading = ref(false)
|
|
|
+const smsAuthClick = async () => {
|
|
|
+ smsAuthLoading.value = true
|
|
|
+ const showAuth = isCheckSmsCodeTime()
|
|
|
+ if (showAuth) {
|
|
|
+ smsAuthKey.value = '1'
|
|
|
+ SMSAuthShow.value = showAuth
|
|
|
+ smsAuthLoading.value = false
|
|
|
+ } else {
|
|
|
+ await SMSAuthConfirm(true)
|
|
|
+ smsAuthLoading.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//公章认证
|
|
|
+const uKeyAuthLoading = ref(false)
|
|
|
+const uKeyAuthClick = async () => {
|
|
|
+ smsAuthLoading.value = true
|
|
|
+ const isUsb = await getUsbDevices()
|
|
|
+ console.log('isUsb:', isUsb)
|
|
|
+ if (!isUsb) {
|
|
|
+ smsAuthKey.value = '2'
|
|
|
+ SMSAuthShow.value = true
|
|
|
+ smsAuthLoading.value = false
|
|
|
+ } else {
|
|
|
+ await SMSAuthConfirm(false)
|
|
|
+ smsAuthLoading.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//取消
|
|
|
+const smsAndUKeyCancel = () => {
|
|
|
+ smsAuthKey.value = '1'
|
|
|
+ isSmsAndUKey.value = false
|
|
|
+ smsAuthLoading.value = false
|
|
|
+ uKeyAuthLoading.value = false
|
|
|
+}
|
|
|
+
|
|
|
+//获取Ukey设备
|
|
|
+const getUsbDevices = async () => {
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ navigator.usb.getDevices().then(devices => {
|
|
|
+ console.log(devices)
|
|
|
+ let CFIST = false
|
|
|
+ for (let i = 0; i < devices.length; i++) {
|
|
|
+ if (devices[i].manufacturerName === 'CFIST') {
|
|
|
+ CFIST = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ useAppState.setIsUKey(CFIST)
|
|
|
+ isUKey.value = CFIST
|
|
|
+ resolve(CFIST)
|
|
|
+ }).catch(() => {
|
|
|
+ resolve(false)
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//短信验证有效期
|
|
|
+const smsCodeTime = ref('')
|
|
|
+const checkSmsCode = async () => {
|
|
|
+ const { error, code, data } = await tasksApi.checkSmsCode()
|
|
|
+ //处理数据
|
|
|
+ if (!error && code === 200) {
|
|
|
+ smsCodeTime.value = isString(data) ? data : ''
|
|
|
+ } else {
|
|
|
+ smsCodeTime.value = ''
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//验证短信有效期
|
|
|
+const isCheckSmsCodeTime = () => {
|
|
|
+ const smsTime = smsCodeTime.value
|
|
|
+ if (!smsTime) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ const toDayTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ return dayjs(smsTime).isBefore(toDayTime)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//短信验证
|
|
|
+const SMSAuthLoading = ref(false)
|
|
|
+const SMSAuthShow = ref(false)
|
|
|
+const SMSAuthConfirm = async (sms = true) => {
|
|
|
+ const type = taskReviewType.value
|
|
|
+ if (type === '1') {
|
|
|
+ await saveCompleteApprovalTask()
|
|
|
+ } else {
|
|
|
+ await batchCompleteApprovalTask()
|
|
|
+ }
|
|
|
+ if (sms) await checkSmsCode()
|
|
|
+ isSmsAndUKey.value = false
|
|
|
+ setTimeout(() => {
|
|
|
+ window?.location?.reload() //刷新页面
|
|
|
+ }, 3000)
|
|
|
+}
|
|
|
+const SMSAuthCancel = () => {
|
|
|
+ SMSAuthShow.value = false
|
|
|
+}
|
|
|
+
|
|
|
+//单个审批
|
|
|
+const saveCompleteApprovalTask = async () => {
|
|
|
+ const DataInfo = taskReviewInfo.value
|
|
|
+ SMSAuthLoading.value = true
|
|
|
+ const { error, code } = await tasksApi.saveCompleteApprovalTask({
|
|
|
+ ...taskReviewForm.value,
|
|
|
+ taskId: DataInfo['id'] || '',
|
|
|
+ parallelProcessInstanceId: DataInfo['parallelProcessInstanceId'] || '',
|
|
|
+ formDataId: DataInfo['formDataId'] || '',
|
|
|
+ approvalType: DataInfo['approvalType'],
|
|
|
+ }, false)
|
|
|
+ //处理数据
|
|
|
+ SMSAuthLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ SMSAuthShow.value = false
|
|
|
+ showTaskReviewModal.value = false
|
|
|
+ window?.$message?.success('审批成功')
|
|
|
+ } else {
|
|
|
+ window?.$message?.warning('审批异常')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//批量审批
|
|
|
+const batchCompleteApprovalTask = async () => {
|
|
|
+ const rows = checkedRowsRef.value
|
|
|
+ SMSAuthLoading.value = true
|
|
|
+ let taskIds = arrToKey(rows, 'id', ',')
|
|
|
+ let approvalType = arrToKey(rows, 'approvalType', ',')
|
|
|
+ let formDataId = arrToKey(rows, 'formDataId', ',')
|
|
|
+ let parallelProcessInstanceIds = arrToKey(rows, 'parallelProcessInstanceId', ',')
|
|
|
+ const { error, code, msg } = await tasksApi.batchCompleteApprovalTask({
|
|
|
+ ...taskReviewForm.value,
|
|
|
+ taskIds,
|
|
|
+ approvalType,
|
|
|
+ formDataId,
|
|
|
+ parallelProcessInstanceIds,
|
|
|
+ projectId:projectId.value,
|
|
|
+ contractId:contractId.value,
|
|
|
+ }, false)
|
|
|
+ //处理数据
|
|
|
+ SMSAuthLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ SMSAuthShow.value = false
|
|
|
+ showTaskReviewModal.value = false
|
|
|
+ window?.$message?.success('审批成功')
|
|
|
+ } else {
|
|
|
+ window?.$message?.warning(msg)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//设置重签规则
|
|
|
+const showSetSignRulesModal = ref(false)
|
|
|
+const setPactVal = ref(true)
|
|
|
+const formReport = ref({ date: 1, active: true })
|
|
|
+const setSignRulesClick = () => {
|
|
|
+ showSetSignRulesModal.value = true
|
|
|
+}
|
|
|
+const dateUpdateValue = (val) => {
|
|
|
+ formReport.value.date = val
|
|
|
+}
|
|
|
+const selectContracId = ref(useAppState.getContractId)
|
|
|
+const changeselectContracId = (val)=>{
|
|
|
+ selectContracId.value = val
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import '../../styles/tasks/hc-data.scss';
|
|
|
+</style>
|