Compare commits

...

3 Commits

9 changed files with 219 additions and 47 deletions

View File

@@ -18,14 +18,22 @@ import VueOfficeDocx from '@vue-office/docx'
import VueOfficeExcel from '@vue-office/excel' import VueOfficeExcel from '@vue-office/excel'
//引入VueOfficePdf组件 //引入VueOfficePdf组件
import VueOfficePdf from '@vue-office/pdf' import VueOfficePdf from '@vue-office/pdf'
import { downloadFile } from '@/api/system-boot/file'
const { push, options, currentRoute } = useRouter() const { push, options, currentRoute } = useRouter()
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
// const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1] // const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1]
const url = ref('')
const excelOptions = ref({})
if(VITE_FLAG){
url.value = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
excelOptions.value = ref({
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
})
}else{
//下载
}
const url = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
console.log("🚀 ~ url:", url)
const excelOptions = ref({
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
})
onMounted(() => { onMounted(() => {
console.log() console.log()
}) })

View File

@@ -36,8 +36,8 @@
//引入相关样式 //引入相关样式
import '@vue-office/excel/lib/index.css' import '@vue-office/excel/lib/index.css'
//引入VueOfficeDocx组件 //引入VueOfficeDocx组件
import VueOfficeDocx from '@vue-office/docx' import VueOfficeDocx from '@vue-office/docx'
import VueOfficeExcel from '@vue-office/excel' import VueOfficeExcel from '@vue-office/excel'
//引入VueOfficePdf组件 //引入VueOfficePdf组件
import VueOfficePdf from '@vue-office/pdf' import VueOfficePdf from '@vue-office/pdf'
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
@@ -52,12 +52,18 @@ const num = ref(0)
const url = ref('') const url = ref('')
const excelOptions = ref({}) const excelOptions = ref({})
const information = adminInfo.roleCode.includes('information_info') const information = adminInfo.roleCode.includes('information_info')
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
const open = (row: any) => { const open = (row: any) => {
// console.log('🚀 ~ open ~ row:', row) // console.log('🚀 ~ open ~ row:', row)
// url.value = row // url.value = row
drawer.value = true drawer.value = true
url.value = `/api-docx/excelreport` + row if(VITE_FLAG){
excelOptions.value = { xls: row.split('.')[1] == 'xls' ? true : false } url.value = `/api-docx/excelreport` + row
excelOptions.value = { xls: row.split('.')[1] == 'xls' ? true : false }
}else{
}
// getFileNameAndFilePath({ filePath: row }).then(res => { // getFileNameAndFilePath({ filePath: row }).then(res => {
// url.value = res.data.url // url.value = res.data.url
// }) // })

View File

@@ -77,6 +77,8 @@ onMounted(() => {
} }
}) })
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
const handleNodeClick = (data: any, node: any) => { const handleNodeClick = (data: any, node: any) => {
console.log("🚀 ~ handleNodeClick ~ data:", data) console.log("🚀 ~ handleNodeClick ~ data:", data)
dotList.value = data dotList.value = data
@@ -86,8 +88,13 @@ const handleNodeClick = (data: any, node: any) => {
flag.value = true flag.value = true
setTimeout(() => { setTimeout(() => {
url.value = `/api-docx/excelreport` + data.url if(VITE_FLAG){
excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false } url.value = `/api-docx/excelreport` + data.url
excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false }
}else{
}
// getFileNameAndFilePath({ filePath: data.url }).then(res => { // getFileNameAndFilePath({ filePath: data.url }).then(res => {
// url.value = res.data.url // url.value = res.data.url
// }) // })

View File

@@ -181,6 +181,7 @@ import { useAdminInfo } from '@/stores/adminInfo'
import { uploadFile } from '@/api/system-boot/file' import { uploadFile } from '@/api/system-boot/file'
import { submitGoNet } from '@/api/supervision-boot/interfere/index' import { submitGoNet } from '@/api/supervision-boot/interfere/index'
import { getUserReportById } from '@/api/supervision-boot/userReport/form' import { getUserReportById } from '@/api/supervision-boot/userReport/form'
import { lo } from 'element-plus/es/locale'
const props = defineProps({ const props = defineProps({
openType: { openType: {
@@ -340,6 +341,8 @@ const handleExceed: UploadProps['onExceed'] = files => {
//移除文件上传 //移除文件上传
const removeFile = (file: any, uploadFiles: any) => { const removeFile = (file: any, uploadFiles: any) => {
console.log(file, uploadFiles) console.log(file, uploadFiles)
goToNetReport.value = ''
form.value.goToNetReport = uploadFiles
} }
// 治理工程验收报告数组 // 治理工程验收报告数组
@@ -373,6 +376,7 @@ const confirmForm = (flag: boolean) => {
}) })
} else { } else {
if (goToNetReport.value == null || goToNetReport.value == '') { if (goToNetReport.value == null || goToNetReport.value == '') {
loading.value = false
return ElMessage({ return ElMessage({
message: props.bussType == 0 ? '请上传入网设计方案审查报告' : '请上传治理工程验收报告', message: props.bussType == 0 ? '请上传入网设计方案审查报告' : '请上传治理工程验收报告',
type: 'warning' type: 'warning'

View File

@@ -201,7 +201,7 @@
</el-form-item> </el-form-item>
<el-form-item class="uploadFile" for="-" label="可研报告:" prop="feasibilityReport"> <el-form-item class="uploadFile" for="-" label="可研报告:" prop="feasibilityReport">
<el-upload v-model:file-list="form.feasibilityReport" ref="uploadRef" action="" :accept="acceptType" <el-upload v-model:file-list="form.feasibilityReport" ref="uploadRef" action="" :accept="acceptType"
:limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile('feasibilityReport')"
:on-progress="uploadFileName('feasibilityReport')"> :on-progress="uploadFileName('feasibilityReport')">
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -210,7 +210,7 @@
</el-form-item> </el-form-item>
<el-form-item class="uploadFile" for="-" label="项目初步设计说明书:" prop="preliminaryDesignDescription"> <el-form-item class="uploadFile" for="-" label="项目初步设计说明书:" prop="preliminaryDesignDescription">
<el-upload v-model:file-list="form.preliminaryDesignDescription" ref="uploadRef" action="" <el-upload v-model:file-list="form.preliminaryDesignDescription" ref="uploadRef" action=""
:accept="acceptType" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile" :accept="acceptType" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile('preliminaryDesignDescription')"
:on-progress="uploadFileName('preliminaryDesignDescription')"> :on-progress="uploadFileName('preliminaryDesignDescription')">
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -219,7 +219,7 @@
</el-form-item> </el-form-item>
<el-form-item class="uploadFile" for="-" label="预测评估报告:" prop="predictionEvaluationReport"> <el-form-item class="uploadFile" for="-" label="预测评估报告:" prop="predictionEvaluationReport">
<el-upload v-model:file-list="form.predictionEvaluationReport" ref="uploadRef" action="" <el-upload v-model:file-list="form.predictionEvaluationReport" ref="uploadRef" action=""
:accept="acceptType" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile" :accept="acceptType" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile('predictionEvaluationReport')"
:on-progress="uploadFileName('predictionEvaluationReport')"> :on-progress="uploadFileName('predictionEvaluationReport')">
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -228,7 +228,7 @@
</el-form-item> </el-form-item>
<el-form-item class="uploadFile" for="-" label="预测评估评审意见报告:" prop="predictionEvaluationReviewOpinions"> <el-form-item class="uploadFile" for="-" label="预测评估评审意见报告:" prop="predictionEvaluationReviewOpinions">
<el-upload v-model:file-list="form.predictionEvaluationReviewOpinions" ref="uploadRef" action="" <el-upload v-model:file-list="form.predictionEvaluationReviewOpinions" ref="uploadRef" action=""
:accept="acceptType" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile" :accept="acceptType" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile('predictionEvaluationReviewOpinions')"
:on-progress="uploadFileName('predictionEvaluationReviewOpinions')"> :on-progress="uploadFileName('predictionEvaluationReviewOpinions')">
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -237,7 +237,7 @@
</el-form-item> </el-form-item>
<el-form-item class="uploadFile" for="-" label="其他附件:" prop="additionalAttachments"> <el-form-item class="uploadFile" for="-" label="其他附件:" prop="additionalAttachments">
<el-upload v-model:file-list="form.additionalAttachments" ref="uploadRef" action="" :accept="acceptType" <el-upload v-model:file-list="form.additionalAttachments" ref="uploadRef" action="" :accept="acceptType"
:limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile('additionalAttachments')"
:on-progress="uploadFileName('additionalAttachments')"> :on-progress="uploadFileName('additionalAttachments')">
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -247,7 +247,7 @@
<el-form-item for="-" class="uploadFile" v-if="form.userType != '0' && form.userType != '1'" <el-form-item for="-" class="uploadFile" v-if="form.userType != '0' && form.userType != '1'"
label="用户接入变电站主接线示意图:" prop="substationMainWiringDiagram"> label="用户接入变电站主接线示意图:" prop="substationMainWiringDiagram">
<el-upload v-model:file-list="form.substationMainWiringDiagram" ref="uploadRef" action="" <el-upload v-model:file-list="form.substationMainWiringDiagram" ref="uploadRef" action=""
:accept="acceptType" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile" :accept="acceptType" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile('substationMainWiringDiagram')"
:on-progress="uploadFileName('substationMainWiringDiagram')"> :on-progress="uploadFileName('substationMainWiringDiagram')">
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -257,7 +257,7 @@
<el-form-item class="uploadFile" for="-" label="主要敏感终端清单:" v-if="form.userType == '6'" <el-form-item class="uploadFile" for="-" label="主要敏感终端清单:" v-if="form.userType == '6'"
prop="sensitiveDevices"> prop="sensitiveDevices">
<el-upload v-model:file-list="form.sensitiveDevices" ref="uploadRef" action="" :accept="acceptType" <el-upload v-model:file-list="form.sensitiveDevices" ref="uploadRef" action="" :accept="acceptType"
:limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile('sensitiveDevices')"
:on-progress="uploadFileName('sensitiveDevices')"> :on-progress="uploadFileName('sensitiveDevices')">
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -267,7 +267,7 @@
<el-form-item class="uploadFile" for="-" v-if="form.userType == '6'" label="抗扰度测试报告:" <el-form-item class="uploadFile" for="-" v-if="form.userType == '6'" label="抗扰度测试报告:"
prop="antiInterferenceReport"> prop="antiInterferenceReport">
<el-upload v-model:file-list="form.antiInterferenceReport" ref="uploadRef" action="" <el-upload v-model:file-list="form.antiInterferenceReport" ref="uploadRef" action=""
:accept="acceptType" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile" :accept="acceptType" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile('antiInterferenceReport')"
:on-progress="uploadFileName('antiInterferenceReport')"> :on-progress="uploadFileName('antiInterferenceReport')">
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -277,7 +277,7 @@
<el-form-item class="uploadFile" for="-" v-if="form.userType == '6'" label="背景电能质量测试报告:" <el-form-item class="uploadFile" for="-" v-if="form.userType == '6'" label="背景电能质量测试报告:"
prop="powerQualityReport"> prop="powerQualityReport">
<el-upload v-model:file-list="form.powerQualityReport" ref="uploadRef" action="" :accept="acceptType" <el-upload v-model:file-list="form.powerQualityReport" ref="uploadRef" action="" :accept="acceptType"
:limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile" :limit="1" :on-change="choose" :auto-upload="false" :on-remove="removeFile('powerQualityReport')"
:on-progress="uploadFileName('powerQualityReport')"> :on-progress="uploadFileName('powerQualityReport')">
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -300,7 +300,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, onMounted, reactive, defineExpose, defineProps, defineEmits, watch, onUnmounted } from 'vue' import { ref, onMounted, reactive, defineExpose, defineProps, defineEmits, watch, onUnmounted } from 'vue'
// import { upload, insertTerminal, updateTerminal } from '@/api/process-boot/terminal' // import { upload, insertTerminal, updateTerminal } from '@/api/process-boot/terminal'
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus' import type { UploadFile, UploadInstance, UploadProps, UploadRawFile } from 'element-plus'
import { genFileId, ElMessage } from 'element-plus' import { genFileId, ElMessage } from 'element-plus'
import { useDictData } from '@/stores/dictData' import { useDictData } from '@/stores/dictData'
import type { ComponentSize, FormInstance, FormRules } from 'element-plus' import type { ComponentSize, FormInstance, FormRules } from 'element-plus'
@@ -499,6 +499,8 @@ const resetForm = () => {
} }
//初始化数据 //初始化数据
resetForm() resetForm()
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
//获取树形图数据 //获取树形图数据
const getTreeList = () => { const getTreeList = () => {
queryByAllCode().then(res => { queryByAllCode().then(res => {
@@ -520,23 +522,58 @@ const getTreeList = () => {
// }) // })
// }) // })
let data = [res.data.find((item: any) => item.code == 'Major_Nonlinear_Device')] let data = [res.data.find((item: any) => item.code == 'Major_Nonlinear_Device')]
nonlinearDeviceTypeList.value = [{ ...JSON.parse(JSON.stringify(...data)), children: [], disabled: 'disabled' }] // nonlinearDeviceTypeList.value = [{ ...JSON.parse(JSON.stringify(...data)), children: [], disabled: 'disabled' }]
data.map((item: any) => {
//tree禁用根节点 // data.map((item: any) => {
item.disabled = 'disabled' // //tree禁用根节点
item.children.map((vv: any) => { // item.disabled = 'disabled'
//tree禁用二级节点 // item.children.map((vv: any) => {
vv.disabled = 'disabled' // //tree禁用二级节点
vv.children.map((kk: any) => { // vv.disabled = 'disabled'
//tree禁用三级节点 // vv.children.map((kk: any) => {
kk.disabled = 'disabled' // //tree禁用三级节点
kk.children.map((ss: any) => { // kk.disabled = 'disabled'
ss.name = vv.name + '-' + kk.name + '-' + ss.name // kk.children.map((ss: any) => {
nonlinearDeviceTypeList.value[0].children.push(ss) // ss.name = vv.name + '-' + kk.name + '-' + ss.name
// nonlinearDeviceTypeList.value[0].children.push(ss)
// })
// })
// })
// })
// })
if (VITE_FLAG) {
// VITE_FLAG为true时保持原有逻辑包含根节点
nonlinearDeviceTypeList.value = [{ ...JSON.parse(JSON.stringify(...data)), children: [], disabled: 'disabled' }]
data.map((item: any) => {
//tree禁用根节点
item.disabled = 'disabled'
item.children.map((vv: any) => {
//tree禁用二级节点
vv.disabled = 'disabled'
vv.children.map((kk: any) => {
//tree禁用三级节点
kk.disabled = 'disabled'
kk.children.map((ss: any) => {
ss.name = vv.name + '-' + kk.name + '-' + ss.name
nonlinearDeviceTypeList.value[0].children.push(ss)
})
}) })
}) })
}) })
}) } else {
// VITE_FLAG为false时去除第一层根节点只保留子节点
nonlinearDeviceTypeList.value = []
data.map((item: any) => {
item.children.map((vv: any) => {
vv.children.map((kk: any) => {
kk.children.map((ss: any) => {
ss.name = vv.name + '-' + kk.name + '-' + ss.name
nonlinearDeviceTypeList.value.push(ss)
})
})
})
})
}
}) })
} }
@@ -811,6 +848,29 @@ const open = async (row: any) => {
} else { } else {
resendId.value = '' resendId.value = ''
form.value.userType = userTypeList.value[0].value form.value.userType = userTypeList.value[0].value
// 清空所有文件引用
feasibilityReport.value = ''
preliminaryDesignDescription.value = ''
predictionEvaluationReport.value = ''
predictionEvaluationReviewOpinions.value = ''
additionalAttachments.value = ''
substationMainWiringDiagram.value = ''
sensitiveDevices.value = ''
antiInterferenceReport.value = ''
powerQualityReport.value = ''
// 清空表单中的文件列表
form.value.feasibilityReport = []
form.value.preliminaryDesignDescription = []
form.value.predictionEvaluationReport = []
form.value.predictionEvaluationReviewOpinions = []
form.value.additionalAttachments = []
form.value.substationMainWiringDiagram = []
form.value.sensitiveDevices = []
form.value.antiInterferenceReport = []
form.value.powerQualityReport = []
} }
setTimeout(() => { setTimeout(() => {
getByDeptDevLine({ id: deptIds }).then(res => { getByDeptDevLine({ id: deptIds }).then(res => {
@@ -896,12 +956,48 @@ const handleExceed: UploadProps['onExceed'] = files => {
} }
let uploadName = ref('') let uploadName = ref('')
//上传报告字段名称 //上传报告字段名称
const uploadFileName = (val: any) => { const uploadFileName = (val: any) => {
uploadName.value = val uploadName.value = val
} }
//移除文件上传
const removeFile = (file: any, uploadFiles: any) => {
console.log(file, uploadFiles) // 移除文件上传
const removeFile = (val: any) => {
return (file: UploadFile, fileList: UploadFile[]) => {
// 根据上传字段名称清除对应的文件引用
switch(val) {
case 'feasibilityReport':
feasibilityReport.value = ''
break
case 'preliminaryDesignDescription':
preliminaryDesignDescription.value = ''
break
case 'predictionEvaluationReport':
predictionEvaluationReport.value = ''
break
case 'predictionEvaluationReviewOpinions':
predictionEvaluationReviewOpinions.value = ''
break
case 'additionalAttachments':
additionalAttachments.value = ''
break
case 'substationMainWiringDiagram':
substationMainWiringDiagram.value = ''
break
case 'sensitiveDevices':
sensitiveDevices.value = ''
break
case 'antiInterferenceReport':
antiInterferenceReport.value = ''
break
case 'powerQualityReport':
powerQualityReport.value = ''
break
}
// 同步更新表单中的文件列表
form.value[val] = fileList
}
} }
// 可研报告数组 // 可研报告数组
const feasibilityReport = ref('') const feasibilityReport = ref('')

View File

@@ -168,7 +168,7 @@
<el-form-item for="-" label="监测终端安装位置:" prop="monitoringDeviceInstallationPosition" class="label_over_warp"> <el-form-item for="-" label="监测终端安装位置:" prop="monitoringDeviceInstallationPosition" class="label_over_warp">
<!-- 电网侧用户侧 --> <!-- 电网侧用户侧 -->
<el-select v-model="form.monitoringDeviceInstallationPosition" clearable style="width: 100%" <el-select v-model="form.monitoringDeviceInstallationPosition" clearable style="width: 100%"
placeholder="请选择监测终端安装位置"> placeholder="请选择监测终端安装位置" disabled>
<el-option v-for="item in monitoringDeviceInstallationPositionList" :key="item.id" <el-option v-for="item in monitoringDeviceInstallationPositionList" :key="item.id"
:label="item.name" :value="item.id"></el-option> :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
@@ -240,9 +240,9 @@
<el-radio :value="0">关闭</el-radio> <el-radio :value="0">关闭</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item for="-" label="电功能:" prop="electroplatingFunction"> <el-form-item for="-" label="电功能:" prop="electroplatingFunction">
<!-- 默认 关闭 下拉框 --> <!-- 默认 关闭 下拉框 -->
<el-select v-model="form.electroplatingFunction" clearable style="width: 100%" placeholder="请选择电功能"> <el-select v-model="form.electroplatingFunction" clearable style="width: 100%" placeholder="请选择电功能">
<el-option v-for="item in electroplatingFunctionList" :key="item.id" :label="item.name" <el-option v-for="item in electroplatingFunctionList" :key="item.id" :label="item.name"
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
@@ -509,10 +509,15 @@ const changeSubstationFlag = () => {
form.value.substationName = substationList.value.find((item: any) => { form.value.substationName = substationList.value.find((item: any) => {
return form.value.substation == item.id return form.value.substation == item.id
})?.name })?.name
// 系统电站选"是"时,安装位置设为"电网侧"
form.value.monitoringDeviceInstallationPosition = '0'
} else { } else {
form.value.substation = '' form.value.substation = ''
form.value.substationName = '' form.value.substationName = ''
form.value.substationVoltageLevel = voltageLevelList[0].id form.value.substationVoltageLevel = voltageLevelList[0].id
// 系统电站选"否"时,安装位置设为"用户侧"
form.value.monitoringDeviceInstallationPosition = '1'
} }
} }
watch( watch(
@@ -1345,9 +1350,14 @@ const confirmForm = async (flag: boolean) => {
loading.value = false loading.value = false
}, 0) }, 0)
} }
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
// 编码改动 // 编码改动
const encode = (e: string) => { const encode = (e: string) => {
form.value.monitoringTerminalName = e.replace(/:/g, '') if(VITE_FLAG){
form.value.monitoringTerminalName = e.replace(/:/g, '')
}
} }
defineExpose({ open }) defineExpose({ open })
</script> </script>

View File

@@ -347,6 +347,7 @@ const cancelLeave = async (row: any) => {
const needGovernance = ref() const needGovernance = ref()
/** 方案审查 */ /** 方案审查 */
const toFangAn = (row: any, typeNo: number) => { const toFangAn = (row: any, typeNo: number) => {
//查询详情拿到needGovernance //查询详情拿到needGovernance
/** 获得数据 */ /** 获得数据 */
getUserReportById(row.id).then(res => { getUserReportById(row.id).then(res => {

View File

@@ -837,6 +837,7 @@ watch(
const resendId = ref('') const resendId = ref('')
const status = ref('') const status = ref('')
const open = async (row: any) => { const open = async (row: any) => {
title.value = row.title title.value = row.title
dialogFormVisible.value = true dialogFormVisible.value = true
let deptIds = adminInfo.$state.deptId let deptIds = adminInfo.$state.deptId

View File

@@ -37,7 +37,7 @@
{{ processInstance?.startUser.deptName }} {{ processInstance?.startUser.deptName }}
</el-form-item> </el-form-item>
<el-card v-if="runningTasks[index].formId != null" style="width: 100%; margin-right: 40%"> <el-card v-if="runningTasks[index].formId != null" style="width: 100%; margin-right: 40%">
<template #header> <template #header>
<span class="el-icon-picture-outline"> <span class="el-icon-picture-outline">
{{ runningTasks[index]?.formName }} {{ runningTasks[index]?.formName }}
@@ -195,15 +195,54 @@ watch(
/** 处理审批通过和不通过的操作 */ /** 处理审批通过和不通过的操作 */
const handleAudit = async (task, pass) => { const handleAudit = async (task, pass) => {
loading.value = true loading.value = true
// 1.1 获得对应表单 // 1.1 获得对应表单
const index = runningTasks.value.indexOf(task) const index = runningTasks.value.indexOf(task)
const auditFormRef = proxy.$refs['form' + index][0] const auditFormRef = proxy.$refs['form' + index][0]
// 1.2 校验表单 // 1.2 校验表单
const elForm = unref(auditFormRef) const elForm = unref(auditFormRef)
if (!elForm) return
const valid = await elForm.validate() if (!elForm){
if (!valid) return loading.value = false
return
}
// const valid = await elForm.validate()
// if (!valid)
// return
try {
const valid = await new Promise((resolve) => {
elForm.validate((isValid) => {
resolve(isValid)
})
})
if (!valid){
loading.value = false
return
}
} catch (error) {
loading.value = false
return
}
// 1.3 验证 approveForms 中的 radio 字段是否都有值
const currentApproveForm = approveForms.value[index];
if (currentApproveForm && currentApproveForm.rule && Array.isArray(currentApproveForm.rule)) {
const emptyRadioFields = currentApproveForm.rule.filter(rule =>
rule.type === 'radio' &&
(rule.value === undefined ||
rule.value === null ||
rule.value === '')
);
if (emptyRadioFields.length > 0) {
ElMessage.error('请确认'+ stepList.value[index].formName +'都已勾选!');
loading.value = false;
return;
}
}
// 2.1 提交审批 // 2.1 提交审批
const data = { const data = {