微调
This commit is contained in:
@@ -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 url = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
const excelOptions = ref({})
|
||||||
console.log("🚀 ~ url:", url)
|
if(VITE_FLAG){
|
||||||
const excelOptions = ref({
|
url.value = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
||||||
|
excelOptions.value = ref({
|
||||||
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
|
//下载
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log()
|
console.log()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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
|
||||||
|
if(VITE_FLAG){
|
||||||
url.value = `/api-docx/excelreport` + row
|
url.value = `/api-docx/excelreport` + row
|
||||||
excelOptions.value = { xls: row.split('.')[1] == 'xls' ? true : false }
|
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
|
||||||
// })
|
// })
|
||||||
|
|||||||
@@ -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(() => {
|
||||||
|
if(VITE_FLAG){
|
||||||
url.value = `/api-docx/excelreport` + data.url
|
url.value = `/api-docx/excelreport` + data.url
|
||||||
excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false }
|
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
|
||||||
// })
|
// })
|
||||||
|
|||||||
@@ -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('请确认试运行分析报告审核要点都已勾选!');
|
||||||
|
loading.value = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 2.1 提交审批
|
// 2.1 提交审批
|
||||||
const data = {
|
const data = {
|
||||||
|
|||||||
Reference in New Issue
Block a user