| | |
| | | <div class="label">相关附件</div> |
| | | <div class="val">{{ formData.attachName || '暂无附件' }}</div> |
| | | </el-col> |
| | | <el-col :span="12" v-if="detailObjectionStatus === '2'"> |
| | | <div class="label">其他异议详情</div> |
| | | <div class="val">{{ formData.otherObjectionDetail }}</div> |
| | | </el-col> |
| | | <el-col :span="12" v-if="detailObjectionStatus === '2'"> |
| | | <div class="label">审核意见</div> |
| | | <div class="val">{{ formData.reviewOpinion }}</div> |
| | | </el-col> |
| | | </el-row> |
| | | <div v-if=" detailObjectionStatus === '1'"> |
| | | <div class="detail-title" :style="{ marginTop:pxToRem(20)}">异议反馈</div> |
| | | <el-form ref="feedbackFormRef" class="gd-dialog-form" :model="feedbackFormData" |
| | | :rules="feedbackRules" label-width="140px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="其他异议详情" prop="otherObjectionDetail"> |
| | | <el-input |
| | | class="gd-input" |
| | | v-model="feedbackFormData.otherObjectionDetail" |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="审核意见" prop="reviewOpinion"> |
| | | <el-input |
| | | class="gd-input" |
| | | v-model="feedbackFormData.reviewOpinion" |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-form |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button |
| | | class="save-btn" |
| | | color="#4C34FF" |
| | | v-if="!dialogReadonly" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | @click="handleSubmit" |
| | | > |
| | | 保存 |
| | | </el-button> |
| | | <el-button color="#F2F3F5" :loading="submitting" :disabled="submitting" @click="handleApply">申请</el-button> |
| | | |
| | | <template #footer> |
| | | <template v-if="!dialogReadonly"> |
| | | <el-button |
| | | class="save-btn" |
| | | color="#4C34FF" |
| | | v-if="!dialogReadonly" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | @click="handleSubmit" |
| | | > |
| | | 保存 |
| | | </el-button> |
| | | <el-button color="#F2F3F5" :loading="submitting" :disabled="submitting" @click="handleApply">申请</el-button> |
| | | </template> |
| | | <template v-if="dialogReadonly && detailObjectionStatus === '1'"> |
| | | <el-button color="#F2F3F5" :loading="submitting" :disabled="submitting" @click="visible = false">取消</el-button> |
| | | |
| | | <el-button |
| | | class="save-btn" |
| | | color="#4C34FF" |
| | | |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | @click="handleFeedbackSubmit" |
| | | |
| | | > |
| | | 反馈 |
| | | </el-button> |
| | | </template> |
| | | <template v-if="detailDemandStatus === '2'"> |
| | | <el-button color="#F2F3F5" :loading="submitting" :disabled="submitting" @click="visible = false">关闭</el-button> |
| | | </template> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | |
| | | gdDataObjectionSubmitApi, |
| | | } from '@/views/orderView/orderDataManage/dataObjection/dataObjectionApi' |
| | | import { putFileAttachApi } from '@/views/orderView/orderDataManage/supplyAdd/supplyAddApi' |
| | | |
| | | import { pxToRem } from '@/utils/rem' |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | | title: '', |
| | |
| | | attachId: '', |
| | | attachName: '', |
| | | } |
| | | ] |
| | | ], |
| | | objectionStatus: '', |
| | | |
| | | }) |
| | | |
| | | // 初始化异议反馈表单数据 |
| | | const initFeedbackForm = () => ({ |
| | | otherObjectionDetail: '', |
| | | reviewOpinion: '', |
| | | objectionStatus: '2' |
| | | }) |
| | | |
| | | // 注入部门树和字典 |
| | | const deptTree = inject('deptTree') |
| | | const treeProps = inject('treeProps') |
| | | const dictObj = inject('dictObj') |
| | | |
| | | const detailObjectionStatus = inject('detailObjectionStatus') |
| | | const emit = defineEmits(['success']) |
| | | const formRef = ref(null) // 表单实例 |
| | | const feedbackFormRef = ref(null) // 反馈表单实例 |
| | | const formData = ref(initForm()) // 表单数据 |
| | | const feedbackFormData = ref(initFeedbackForm()) // 异议反馈表单数据 |
| | | const visible = defineModel() // 弹框显隐 |
| | | const dialogMode = ref('add') // 弹框模式 |
| | | const submitting = ref(false) // 提交中 |
| | |
| | | catalogResourceName: fieldRules(true), |
| | | objectionDesc: fieldRules(true), |
| | | objectionBasis: fieldRules(true), |
| | | } |
| | | |
| | | // 异议反馈表单校验规则 |
| | | const feedbackRules = { |
| | | otherObjectionDetail: fieldRules(true), |
| | | reviewOpinion: fieldRules(true), |
| | | } |
| | | |
| | | // 自定义上传请求 |
| | |
| | | ElMessage.error(error?.message || '文件上传失败,请重试') |
| | | } |
| | | |
| | | // 提交新增/编辑 |
| | | async function handleSubmit() { |
| | | // 提交数据的通用函数 |
| | | async function submitForm(objectionStatus) { |
| | | const isValid = await formRef.value?.validate().catch(() => false) |
| | | if (!isValid) return |
| | | submitting.value = true |
| | |
| | | objectionDesc: formData.value.objectionDesc, |
| | | objectionBasis: formData.value.objectionBasis, |
| | | areaCode: formData.value.areaCode || '', |
| | | handleUnit: formData.value.handleUnit || '', |
| | | objectionStatus: formData.value.objectionStatus || '', |
| | | otherObjectionDetail: formData.value.otherObjectionDetail || '', |
| | | reviewOpinion: formData.value.reviewOpinion || '', |
| | | // 构建附件列表 |
| | | attachmentList: uploadedFiles.value.map(file => ({ |
| | | attachId: file.attachId, |
| | | attachName: file.originalName, |
| | | })) |
| | | })), |
| | | objectionStatus: objectionStatus |
| | | } |
| | | await gdDataObjectionSubmitApi(submitData) |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | |
| | | submitting.value = false |
| | | } |
| | | } |
| | | |
| | | // 提交新增/编辑(保存) |
| | | async function handleSubmit() { |
| | | await submitForm('0') |
| | | } |
| | | |
| | | // 申请提交 |
| | | async function handleApply() { |
| | | await submitForm('1') |
| | | } |
| | | |
| | | // 处理异议反馈提交 |
| | | async function handleFeedbackSubmit() { |
| | | // 验证反馈表单 |
| | | const isValid = await feedbackFormRef.value?.validate().catch(() => false) |
| | | if (!isValid) return |
| | | submitting.value = true |
| | | try { |
| | | // 构建反馈提交数据 |
| | | const submitData = { |
| | | id: formData.value.id, |
| | | otherObjectionDetail: feedbackFormData.value.otherObjectionDetail || '', |
| | | reviewOpinion: feedbackFormData.value.reviewOpinion || '', |
| | | objectionStatus: '2' |
| | | } |
| | | await gdDataObjectionSubmitApi(submitData) |
| | | ElMessage.success('反馈提交成功') |
| | | visible.value = false |
| | | emit('success') |
| | | } finally { |
| | | submitting.value = false |
| | | } |
| | | } |
| | | // 加载详情 |
| | | async function loadDetail() { |
| | |
| | | // 重置文件列表 |
| | | fileList.value = [] |
| | | uploadedFiles.value = [] |
| | | // 重置表单数据 |
| | | formData.value = dialogMode.value === 'add' ? initForm() : row |
| | | // 重置反馈表单数据 |
| | | feedbackFormData.value = initFeedbackForm() |
| | | if (dialogMode.value !== 'add') { |
| | | await loadDetail() |
| | | } |