From 89380e6260a75d1d3b94de687ebcc2f50d50659d Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 03 Feb 2026 15:44:33 +0800
Subject: [PATCH] feat:环境变量配置调整
---
applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/FormDiaLog.vue | 208 +++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 173 insertions(+), 35 deletions(-)
diff --git a/applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/FormDiaLog.vue b/applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/FormDiaLog.vue
index 6d685f0..0ef053d 100644
--- a/applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/FormDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/FormDiaLog.vue
@@ -8,6 +8,7 @@
:close-on-click-modal="false"
>
<div class="detail-container detail-container1" v-if="dialogReadonly">
+ <div class="detail-title">异议详情</div>
<el-row class="detail-row-view">
<el-col :span="12">
<div class="label">标题</div>
@@ -50,7 +51,7 @@
<div class="val">{{ formData.reviewOpinion }}</div>
</el-col>
</el-row>
- <div v-if=" detailObjectionStatus === '1' && !requesterProvider">
+ <div v-if=" detailObjectionStatus === '1' && permission.orderData_feedback">
<div class="detail-title" :style="{ marginTop:pxToRem(20)}">异议反馈</div>
<el-form ref="feedbackFormRef" class="gd-dialog-form" :model="feedbackFormData"
:rules="feedbackRules" label-width="140px">
@@ -188,7 +189,7 @@
</el-button>
<el-button class="" color="#4C34FF" :loading="submitting || uploading" :disabled="submitting || uploading" @click="handleApply">申请</el-button>
</template>
- <template v-if="dialogReadonly && detailObjectionStatus === '1' && !requesterProvider">
+ <template v-if="dialogReadonly && detailObjectionStatus === '1' && permission.orderData_feedback">
<el-button color="#F2F3F5" :loading="submitting" :disabled="submitting" @click="visible = false">取消</el-button>
<el-button
@@ -218,6 +219,42 @@
<!-- <el-button color="#F2F3F5" :loading="submitting" :disabled="submitting" @click="visible = false">关闭</el-button>-->
</template>
</template>
+
+ <!-- 申请弹框 -->
+ <el-dialog
+ class="gd-dialog"
+ v-model="showApplyDialog"
+ title="申请"
+ @closed="handleApplyDialogClosed"
+ width="500px"
+ destroy-on-close
+ :close-on-click-modal="false"
+ >
+ <el-form class="gd-dialog-form" ref="applyFormRef" :model="applyFormData" :rules="applyRules">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="申请对象部门" prop="applyTargetDeptId">
+ <el-tree-select
+ class="gd-select"
+ popper-class="gd-tree-select-popper"
+ v-model="applyFormData.applyTargetDeptId"
+ node-key="id"
+ :data="deptTree"
+ :props="treeProps"
+ check-strictly
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <template #footer>
+ <el-button color="#F2F3F5" @click="showApplyDialog = false">取消</el-button>
+ <el-button class="" color="#4C34FF" :loading="applying" :disabled="applying" @click="handleApplySubmit">
+ 确认
+ </el-button>
+ </template>
+ </el-dialog>
</el-dialog>
</template>
@@ -234,7 +271,8 @@
import { pxToRem } from '@/utils/rem'
import { useStore } from 'vuex'
const store = useStore()
-const requesterProvider = computed(() => store.state.user.userInfo?.role_id === '2014158512610869250')
+const permission = computed(() => store.state.user.permission);
+// const requesterProvider = computed(() => store.state.user.userInfo?.role_id === '2014158512610869250')
// 初始化表单数据
const initForm = () => ({
id:'',
@@ -283,6 +321,14 @@
const attachmentDetailsList = ref([])
const uploading = ref(false) // 文件上传中状态
+// 申请弹框相关
+const showApplyDialog = ref(false)
+const applyFormRef = ref(null)
+const applying = ref(false)
+const applyFormData = ref({
+ applyTargetDeptId: ''
+})
+
// 表单校验规则
const rules = {
title: fieldRules(true),
@@ -292,7 +338,7 @@
catalogResourceName: fieldRules(true),
objectionDesc: fieldRules(true),
objectionBasis: fieldRules(true),
- // attachId: dialogMode.value === 'add' ? fieldRules(true) : fieldRules(false)
+ attachId: fieldRules(true)
}
@@ -300,6 +346,11 @@
const feedbackRules = {
otherObjectionDetail: fieldRules(true),
reviewOpinion: fieldRules(true),
+}
+
+// 申请弹框校验规则
+const applyRules = {
+ applyTargetDeptId: fieldRules(true),
}
// 自定义上传请求
@@ -323,9 +374,6 @@
}
// 文件移除
-// const handleFileRemove = (file, fileListVal) => {
-// uploadedFiles.value = fileListVal
-// }
const handleFileRemove = (file, fileListVal) => {
// 从展示列表中移除
fileList.value = fileListVal
@@ -375,6 +423,7 @@
// 提交数据的通用函数
async function submitForm(objectionStatus) {
+formData.value.attachId = uploadedFiles.value.length > 0 ? uploadedFiles.value.length : ''
const isValid = await formRef.value?.validate().catch(() => false)
if (!isValid) return
@@ -408,13 +457,6 @@
}),
objectionStatus: objectionStatus
}
-
- // 如果是编辑且没有修改附件,可以保留原有附件ID
- if (dialogMode.value === 'edit' && formData.value.attachIds) {
- // 这里可以根据业务需求决定是否保留原附件ID
- // 如果接口支持更新时重新上传附件ID列表,可以这样做
- }
-
await gdDataObjectionSubmitApi(submitData)
ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功')
visible.value = false
@@ -429,9 +471,66 @@
await submitForm('0')
}
-// 申请提交
+// 申请弹框关闭处理
+function handleApplyDialogClosed() {
+ applyFormData.value.applyTargetDeptId = ''
+}
+
+// 申请
async function handleApply() {
- await submitForm('1')
+ formData.value.attachId = uploadedFiles.value.length > 0 ? uploadedFiles.value.length : ''
+ // 先验证主表单
+ const mainFormValid = await formRef.value?.validate().catch(() => false)
+ if (!mainFormValid) return
+
+ showApplyDialog.value = true
+}
+
+// 申请提交
+async function handleApplySubmit() {
+ const isValid = await applyFormRef.value?.validate().catch(() => false)
+ if (!isValid) return
+ applying.value = true
+ try {
+ // 构建申请数据
+ const applyData = {
+ ...formData.value,
+ objectionStatus: '1',
+ applyTargetDeptId: applyFormData.value.applyTargetDeptId
+ }
+
+ // 构建符合接口要求的提交数据
+ const submitData = {
+ // 编辑模式下传递id
+ ...(applyData.id && { id: applyData.id }),
+ title: applyData.title,
+ objectionType: applyData.objectionType,
+ submitter: applyData.submitter,
+ submitterContact: applyData.submitterContact,
+ catalogResourceName: applyData.catalogResourceName,
+ objectionDesc: applyData.objectionDesc,
+ objectionBasis: applyData.objectionBasis,
+ areaCode: applyData.areaCode || '',
+ handleUnit: applyData.handleUnit || '',
+ // 构建附件列表 - 使用当前已上传的文件(包括回显的)
+ ...(uploadedFiles.value.length > 0 && {
+ attachmentList: uploadedFiles.value.map(file => ({
+ attachId: file.attachId,
+ attachName: file.originalName,
+ })),
+ }),
+ objectionStatus: applyData.objectionStatus,
+ applyTargetDeptId: applyData.applyTargetDeptId
+ }
+
+ await gdDataObjectionSubmitApi(submitData)
+ ElMessage.success('申请成功')
+ showApplyDialog.value = false
+ visible.value = false
+ emit('success')
+ } finally {
+ applying.value = false
+ }
}
// 处理异议反馈提交
@@ -504,27 +603,64 @@
attachmentDetailsList.value = results.map(res => res.data.data).filter(Boolean)
}
// 处理附件下载
-async function handleDownloadAttach() {
- if (attachmentDetailsList.value.length === 0) {
- ElMessage.warning('没有可下载的附件')
- return
- }
+const handleDownloadAttach = async () => {
+ if (!attachmentDetailsList.value || attachmentDetailsList.value.length === 0) {
+ ElMessage.warning('没有可下载的附件')
+ return
+ }
+ // 顺序下载每个附件
+ for (let i = 0; i < attachmentDetailsList.value.length; i++) {
+ const attach = attachmentDetailsList.value[i]
+
+ if (!attach.link) {
+ console.warn(`附件 ${attach.originalName || attach.name} 链接无效,跳过`)
+ continue
+ }
- // 遍历所有附件并下载
- attachmentDetailsList.value.forEach(attach => {
- if (attach.link) {
- const link = document.createElement('a')
- link.href = attach.link
- link.download = attach.originalName || attach.name
- link.style.display = 'none'
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link)
- }
- })
+ try {
+ const response = await fetch(attach.link)
+ const blob = await response.blob()
+ const url = window.URL.createObjectURL(blob)
+ const a = document.createElement('a')
+ a.href = url
+
+ // 设置文件名:优先使用 originalName
+ let fileName = attach.originalName || attach.name || `附件_${i + 1}`
+
+ // 确保有扩展名
+ if (fileName && !fileName.includes('.')) {
+ const contentType = response.headers.get('content-type')
+ if (contentType && contentType.includes('zip')) {
+ fileName += '.zip'
+ } else if (contentType && contentType.includes('rar')) {
+ fileName += '.rar'
+ } else {
+ fileName += '.zip'
+ }
+ }
+
+ a.download = fileName
+ a.style.display = 'none'
+ document.body.appendChild(a)
+ a.click()
+
+ // 清理
+ setTimeout(() => {
+ window.URL.revokeObjectURL(url)
+ document.body.removeChild(a)
+ }, 100)
+
+ // 文件间延迟(除了最后一个)
+ if (i < attachmentDetailsList.value.length - 1) {
+ await new Promise(resolve => setTimeout(resolve, 1000))
+ }
+
+ } catch (error) {
+ console.error(`下载失败: ${attach.originalName || attach.name}`, error)
+ }
+ }
+
}
-
-
// 打开弹框
async function open({ mode = 'add', row } = {}) {
dialogMode.value = mode
@@ -535,6 +671,8 @@
formData.value = dialogMode.value === 'add' ? initForm() : row
// 重置反馈表单数据
feedbackFormData.value = initFeedbackForm()
+ // 重置申请弹框数据
+ applyFormData.value.applyTargetDeptId = ''
if (dialogMode.value !== 'add') {
// 如果是编辑,设置ID并加载详情
--
Gitblit v1.9.3