| | |
| | | </div> |
| | | <template #footer> |
| | | <template v-if="detailDemandStatus === '1' && !requesterProvider"> |
| | | <el-button color="#F2F3F5" @click="rejectTheApplication">拒绝申请</el-button> |
| | | <el-button class="" color="#4C34FF" @click="approvedByTheReview">审核通过</el-button> |
| | | <el-button color="#F2F3F5" :loading="submitting" :disabled="submitting" @click="rejectTheApplication">拒绝申请</el-button> |
| | | <el-button class="" color="#4C34FF" :loading="submitting" :disabled="submitting" @click="approvedByTheReview">审核通过</el-button> |
| | | </template> |
| | | <template v-if="detailDemandStatus === '2'"> |
| | | <el-button class="" color="#4C34FF" @click="downloadAllFiles">全部下载</el-button> |
| | |
| | | const fileList = ref([]) // 上传文件列表 |
| | | const uploadedFiles = ref([]) // 已上传文件列表 |
| | | const responseData = ref(null) |
| | | const submitting = ref(false) // 提交中状态 |
| | | // 自定义上传请求函数 |
| | | const handleHttpRequest = async (options) => { |
| | | try { |
| | |
| | | const tableData = ref([]) // 附件表格数据 |
| | | // 文件移除 |
| | | const handleFileRemove = (file, fileList) => { |
| | | console.log('删除文件', fileList); |
| | | uploadedFiles.value = fileList |
| | | // 从已上传文件列表中移除对应文件 |
| | | if (file.response && file.response.attachId) { |
| | | uploadedFiles.value = uploadedFiles.value.filter(item => item.attachId !== file.response.attachId) |
| | | } |
| | | // if (file.response && file.response.attachId) { |
| | | // // uploadedFiles.value = uploadedFiles.value.filter(item => item.attachId !== file.response.attachId) |
| | | // // 找到 id=1 的对象的索引 |
| | | // const index = uploadedFiles.value.findIndex(item => item.attachId !== file.response.attachId) |
| | | |
| | | // // 如果找到了,移除该对象 |
| | | // if (index !== -1) { |
| | | // uploadedFiles.value.splice(index, 1) |
| | | // } |
| | | // console.log('删除文件', uploadedFiles.value); |
| | | |
| | | // } |
| | | // 清空响应数据 |
| | | if (responseData.value && responseData.value.attachId === file.response?.attachId) { |
| | | responseData.value = null |
| | |
| | | // 从 uploadedFiles.value 中提取所有 attachId |
| | | const id = uploadedFiles.value.map(file => file.attachId) |
| | | |
| | | submitting.value = true |
| | | gdSupplyDemandAuditRejectApi({ attachIds: id, auditOpinion: reason, demandId: demandId.value }) |
| | | .then(() => { |
| | | ElMessage.success('拒绝申请成功') |
| | |
| | | ElMessage.error('拒绝申请失败,请重试') |
| | | emit('success') |
| | | }) |
| | | .finally(() => { |
| | | submitting.value = false |
| | | }) |
| | | } |
| | | // 审核通过 |
| | | const approvedByTheReview = () => { |
| | | if (uploadedFiles.value.length === 0) { |
| | | return ElMessage.warning('请上传数据') |
| | | } |
| | | } |
| | | // 从 uploadedFiles.value 中提取所有 attachId |
| | | const id = uploadedFiles.value.map(file => file.attachId) |
| | | gdSupplyDemandAuditPassApi({ attachIds: id, demandId: demandId.value }).then(() => { |
| | | ElMessage.success('审核通过成功') |
| | | visible.value = false |
| | | emit('success') |
| | | }) |
| | | submitting.value = true |
| | | gdSupplyDemandAuditPassApi({ attachIds: id, demandId: demandId.value }) |
| | | .then(() => { |
| | | ElMessage.success('审核通过成功') |
| | | visible.value = false |
| | | emit('success') |
| | | }) |
| | | .finally(() => { |
| | | submitting.value = false |
| | | }) |
| | | } |
| | | |
| | | defineExpose({ open }) |
| | |
| | | :deep(.el-upload-list) { |
| | | margin-top: 10px; |
| | | } |
| | | .el-upload-list__item.is-success:focus .el-upload-list__item-status-label, .el-upload-list__item.is-success:hover .el-upload-list__item-status-label{ |
| | | display: none !important;} |
| | | </style> |