|
|
|
@ -7,7 +7,13 @@
|
|
|
|
|
<img src="/src/assets/imgs/status/status16.png" v-if="formData.notificationStatus == 3" alt="" />
|
|
|
|
|
<img src="/src/assets/imgs/status/status8.png" v-else-if="formData.notificationStatus == 2" alt="" />
|
|
|
|
|
</div> -->
|
|
|
|
|
<el-form ref="formRef" label-width="160px" :rules="formRules" :model="formData" v-loading="formLoading">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="formRef"
|
|
|
|
|
label-width="160px"
|
|
|
|
|
:rules="formRules"
|
|
|
|
|
:model="formData"
|
|
|
|
|
v-loading="formLoading"
|
|
|
|
|
>
|
|
|
|
|
<!-- 基础信息 横向布局 -->
|
|
|
|
|
<el-card class="hl-card-info">
|
|
|
|
|
<template #header>
|
|
|
|
@ -16,13 +22,28 @@
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="品质异常通知单" prop="code">
|
|
|
|
|
<el-input disabled class="!w-260px" v-model="formData.code" placeholder="请输入品异常通知单" />
|
|
|
|
|
<el-input
|
|
|
|
|
disabled
|
|
|
|
|
class="!w-260px"
|
|
|
|
|
v-model="formData.code"
|
|
|
|
|
placeholder="请输入品异常通知单"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="质检类型" prop="type">
|
|
|
|
|
<el-select disabled class="!w-260px" v-model="formData.type" placeholder="请选择质检类型">
|
|
|
|
|
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.BIZ_INSPECTION_TYPE)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
<el-select
|
|
|
|
|
disabled
|
|
|
|
|
class="!w-260px"
|
|
|
|
|
v-model="formData.type"
|
|
|
|
|
placeholder="请选择质检类型"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.BIZ_INSPECTION_TYPE)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -41,7 +62,12 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="生产车间" prop="workshopId">
|
|
|
|
|
<WorkshopSelect disabled v-model="formData.workshopId" class="!w-260px" @update:newValue="handleSelectedWorkshop" />
|
|
|
|
|
<WorkshopSelect
|
|
|
|
|
disabled
|
|
|
|
|
v-model="formData.workshopId"
|
|
|
|
|
class="!w-260px"
|
|
|
|
|
@update:newValue="handleSelectedWorkshop"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
@ -73,24 +99,107 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="异常数量" prop="amount">
|
|
|
|
|
<el-input disabled class="!w-260px" v-model="formData.amount" placeholder="请输入异常数量" />
|
|
|
|
|
<el-input
|
|
|
|
|
disabled
|
|
|
|
|
class="!w-260px"
|
|
|
|
|
v-model="formData.amount"
|
|
|
|
|
placeholder="请输入异常数量"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="责任人" prop="owner">
|
|
|
|
|
<el-input disabled v-model="formData.ownerName" class="!w-260px" placeholder="请输入责任人" />
|
|
|
|
|
<el-input
|
|
|
|
|
disabled
|
|
|
|
|
v-model="formData.ownerName"
|
|
|
|
|
class="!w-260px"
|
|
|
|
|
placeholder="请输入责任人"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="16">
|
|
|
|
|
<el-form-item label="情况描述" prop="remark">
|
|
|
|
|
<el-input type="textarea" disabled v-model="formData.remark" placeholder="请输入情况描述" />
|
|
|
|
|
<el-input
|
|
|
|
|
type="textarea"
|
|
|
|
|
disabled
|
|
|
|
|
v-model="formData.remark"
|
|
|
|
|
placeholder="请输入情况描述"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
<!-- 附件信息 -->
|
|
|
|
|
<el-card class="hl-card-info" v-if="active != 'create'">
|
|
|
|
|
<template #header>
|
|
|
|
|
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">附件信息</span>
|
|
|
|
|
</template>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col v-if="active != 'detail'">
|
|
|
|
|
<el-upload
|
|
|
|
|
ref="attachmentUploadRef"
|
|
|
|
|
multiple
|
|
|
|
|
:action="uploadUrl"
|
|
|
|
|
:headers="uploadHeaders"
|
|
|
|
|
name="files"
|
|
|
|
|
:show-file-list="false"
|
|
|
|
|
:auto-upload="false"
|
|
|
|
|
:data="uploadData"
|
|
|
|
|
:on-change="attachmentUploadChange"
|
|
|
|
|
:on-error="handleError"
|
|
|
|
|
:on-success="handleSuccess"
|
|
|
|
|
:before-upload="before"
|
|
|
|
|
class="upload-file-uploader"
|
|
|
|
|
>
|
|
|
|
|
<el-button type="primary"> <Icon icon="ep:upload-filled" />上传 </el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col>
|
|
|
|
|
<el-card class="hl-incard">
|
|
|
|
|
<el-table
|
|
|
|
|
:data="formData.attachments"
|
|
|
|
|
class="hl-table"
|
|
|
|
|
v-loading.fullscreen.lock="uploading"
|
|
|
|
|
element-loading-text="附件上传中..."
|
|
|
|
|
element-loading-background="rgba(122, 122, 122, 0.6)"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column prop="name" label="文件名称" align="center" />
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="createTime"
|
|
|
|
|
align="center"
|
|
|
|
|
label="上传时间"
|
|
|
|
|
:formatter="dateFormatter"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column label="操作" align="center">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="'update,create,deliver'.indexOf(active) > -1"
|
|
|
|
|
link
|
|
|
|
|
type="danger"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)"
|
|
|
|
|
>
|
|
|
|
|
删除
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="!!scope.row.id"
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="downloadAttachment(scope.row.name, scope.row.url)"
|
|
|
|
|
>
|
|
|
|
|
下载
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-card>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-card>
|
|
|
|
|
<!-- 系统信息 -->
|
|
|
|
|
<el-card class="hl-card-info">
|
|
|
|
|
<template #header>
|
|
|
|
|
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">系统信息</span>
|
|
|
|
@ -103,13 +212,25 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="创建时间" prop="createTime">
|
|
|
|
|
<el-date-picker class="!w-260px" v-model="formData.createTime" type="datetime" value-format="x" placeholder="" disabled />
|
|
|
|
|
<el-date-picker
|
|
|
|
|
class="!w-260px"
|
|
|
|
|
v-model="formData.createTime"
|
|
|
|
|
type="datetime"
|
|
|
|
|
value-format="x"
|
|
|
|
|
placeholder=""
|
|
|
|
|
disabled
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="单据状态" prop="notificationStatus">
|
|
|
|
|
<el-select disabled v-model="formData.notificationStatus" placeholder="">
|
|
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.BIZ_UNQUALIFIED_NOTIFICATION_STATUS)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.BIZ_UNQUALIFIED_NOTIFICATION_STATUS)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -122,13 +243,25 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="审核时间" prop="auditTime">
|
|
|
|
|
<el-date-picker class="!w-260px" v-model="formData.auditTime" type="datetime" value-format="x" placeholder="" disabled />
|
|
|
|
|
<el-date-picker
|
|
|
|
|
class="!w-260px"
|
|
|
|
|
v-model="formData.auditTime"
|
|
|
|
|
type="datetime"
|
|
|
|
|
value-format="x"
|
|
|
|
|
placeholder=""
|
|
|
|
|
disabled
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="审核意见" prop="auditOpinion1">
|
|
|
|
|
<el-select disabled v-model="formData.auditOpinion" placeholder="">
|
|
|
|
|
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.BIZ_UNQUALIFIED_NOTIFICATION_OPINION)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.BIZ_UNQUALIFIED_NOTIFICATION_OPINION)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -137,23 +270,38 @@
|
|
|
|
|
<el-dialog v-model="activeOpinionDialogVisible" title="" width="30%" center>
|
|
|
|
|
<el-form-item label="审核意见" prop="auditOpinion">
|
|
|
|
|
<el-select clearable v-model="formData.auditOpinion" placeholder="请选择审核意见">
|
|
|
|
|
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.BIZ_UNQUALIFIED_NOTIFICATION_OPINION)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.BIZ_UNQUALIFIED_NOTIFICATION_OPINION)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<span class="dialog-footer">
|
|
|
|
|
<el-button @click="activeOpinionDialogVisible = false">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitForm('AUDIT') && (activeOpinionDialogVisible = false)">确 认</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="submitForm('AUDIT') && (activeOpinionDialogVisible = false)"
|
|
|
|
|
>确 认</el-button
|
|
|
|
|
>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div class="text-center hl-footer">
|
|
|
|
|
<el-button @click="goback" size="large">取 消</el-button>
|
|
|
|
|
<el-button v-if="formData.notificationStatus == 2 && active != 'detail'" @click="activeOpinionDialogVisible = true" type="primary" :disabled="formLoading" size="large">审 核</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="formData.notificationStatus == 2 && active != 'detail'"
|
|
|
|
|
@click="activeOpinionDialogVisible = true"
|
|
|
|
|
type="primary"
|
|
|
|
|
:disabled="formLoading"
|
|
|
|
|
size="large"
|
|
|
|
|
>审 核</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref } from 'vue'
|
|
|
|
@ -164,9 +312,12 @@ import { useCommonStore } from '@/store/modules/common'
|
|
|
|
|
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
|
|
|
|
import ProcedureSelect from '@/views/biz/hlvuestyle/procedureSelect.vue'
|
|
|
|
|
import WorkshopSelect from '@/views/biz/hlvuestyle/workshopSelect.vue'
|
|
|
|
|
import type { UploadProps, UploadUserFile } from 'element-plus'
|
|
|
|
|
import { getAccessToken, getTenantId } from '@/utils/auth'
|
|
|
|
|
defineOptions({ name: 'UnqualifiedNotificationDetail' })
|
|
|
|
|
|
|
|
|
|
const reload = inject('reload')
|
|
|
|
|
import { deleteFileLogic, downloadFile, getFilePage } from '@/api/infra/file'
|
|
|
|
|
import download from '@/utils/download'
|
|
|
|
|
const reload: any = inject('reload')
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
const commonStore = useCommonStore()
|
|
|
|
@ -196,7 +347,8 @@ const formData = ref({
|
|
|
|
|
auditor: undefined,
|
|
|
|
|
auditOpinion: undefined,
|
|
|
|
|
status: undefined,
|
|
|
|
|
workshopId: undefined
|
|
|
|
|
workshopId: undefined,
|
|
|
|
|
attachments: []
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
@ -231,7 +383,8 @@ const resetForm = () => {
|
|
|
|
|
auditor: undefined,
|
|
|
|
|
auditOpinion: undefined,
|
|
|
|
|
status: undefined,
|
|
|
|
|
workshopId: undefined
|
|
|
|
|
workshopId: undefined,
|
|
|
|
|
attachments: []
|
|
|
|
|
}
|
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
|
}
|
|
|
|
@ -245,6 +398,17 @@ const queryData = async (id?: number) => {
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
try {
|
|
|
|
|
formData.value = await UnqualifiedNotificationApi.getUnqualifiedNotification(id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 附件信息
|
|
|
|
|
let attParams = {
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 99,
|
|
|
|
|
businessId: id,
|
|
|
|
|
businessType: businessType.value
|
|
|
|
|
}
|
|
|
|
|
formData.value.attachments = (await getFilePage(attParams)).list
|
|
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
formLoading.value = false
|
|
|
|
|
}
|
|
|
|
@ -260,6 +424,12 @@ const submitForm = async (operate) => {
|
|
|
|
|
const data = formData.value as unknown as UnqualifiedNotificationApi.UnqualifiedNotificationVO
|
|
|
|
|
let dataId = await UnqualifiedNotificationApi.operateUnqualifiedNotification(data)
|
|
|
|
|
|
|
|
|
|
// 上传附件
|
|
|
|
|
if (attachmentUploadFiles.value.length > 0) {
|
|
|
|
|
uploadData.value.businessId = formData.value.id
|
|
|
|
|
await attachmentUploadRef.value!.submit()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message.success(t('common.operationSuccess'))
|
|
|
|
|
commonStore.setStore('id', dataId)
|
|
|
|
|
commonStore.setStore('active', 'detail')
|
|
|
|
@ -282,9 +452,136 @@ onMounted(() => {
|
|
|
|
|
})
|
|
|
|
|
//接收车间传递的数据
|
|
|
|
|
const handleSelectedWorkshop = (newValue: any) => {
|
|
|
|
|
console.log(newValue);
|
|
|
|
|
formData.value.workshopId = newValue?.id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//附件上传
|
|
|
|
|
const attachmentUploadRef = ref()
|
|
|
|
|
const attachmentUploadFiles = ref<UploadUserFile[]>([])
|
|
|
|
|
const uploading = ref(false)
|
|
|
|
|
const businessType = ref('QUALITY')
|
|
|
|
|
const uploadUrl = ref(import.meta.env.VITE_UPLOAD_BATCH_URL)
|
|
|
|
|
const uploadData = ref({
|
|
|
|
|
businessType: businessType.value,
|
|
|
|
|
businessId: formData.value.id,
|
|
|
|
|
businessFileType: 'QUALITYAnomaly'
|
|
|
|
|
})
|
|
|
|
|
const uploadHeaders = ref({
|
|
|
|
|
Authorization: 'Bearer ' + getAccessToken(),
|
|
|
|
|
'tenant-id': getTenantId()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const attachmentUploadChange = (file, files) => {
|
|
|
|
|
attachmentUploadFiles.value = files
|
|
|
|
|
refreshAttachments(files, 'QUALITYAnomaly')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 记录待上传、成功上传及失败上传的文件数量
|
|
|
|
|
const sumbefore = ref(0)
|
|
|
|
|
const successfulUploadsCount = ref(0)
|
|
|
|
|
const failedUploadsCount = ref(0)
|
|
|
|
|
const failedAttachments = ref<UploadUserFile[]>([])
|
|
|
|
|
const failedAttachmentsName = ref()
|
|
|
|
|
|
|
|
|
|
// 处理单个文件上传成功的情况
|
|
|
|
|
const handleSuccess = (response: any, file: UploadUserFile) => {
|
|
|
|
|
successfulUploadsCount.value++
|
|
|
|
|
// 更新附件信息等其他逻辑...
|
|
|
|
|
// console.log('上传成功数量', successfulUploadsCount.value)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理单个文件上传失败的情况
|
|
|
|
|
const handleError = (error: Error, file: UploadUserFile) => {
|
|
|
|
|
failedUploadsCount.value++
|
|
|
|
|
if (failedUploadsCount.value > 0) {
|
|
|
|
|
// 当有上传错误时
|
|
|
|
|
// 将失败的附件添加到failedAttachments.value数组中
|
|
|
|
|
failedAttachments.value.push(file)
|
|
|
|
|
failedAttachmentsName.value = failedAttachments.value.map((value) => value.name)
|
|
|
|
|
}
|
|
|
|
|
// console.log('上传失败数量', failedUploadsCount.value)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 文件上传前的钩子
|
|
|
|
|
const before = (rawFile) => {
|
|
|
|
|
sumbefore.value++
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const refreshAttachments = (files, type) => {
|
|
|
|
|
formData.value.attachments = files.filter((value) => value.id)
|
|
|
|
|
// 避免重复添加
|
|
|
|
|
const newFiles = files.filter(
|
|
|
|
|
(file) => !formData.value.attachments.some((att) => att.name === file.name)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < newFiles.length; i++) {
|
|
|
|
|
let file = newFiles[i]
|
|
|
|
|
file.businessFileType = type
|
|
|
|
|
file.createTime = new Date()
|
|
|
|
|
formData.value.attachments.push(file)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 排序
|
|
|
|
|
formData.value.attachments.sort((v1, v2) => v1.createTime - v2.createTime)
|
|
|
|
|
// 文件上传一遍 上传总数等于要上传文件时 刷新页面
|
|
|
|
|
const sum = successfulUploadsCount.value + failedUploadsCount.value
|
|
|
|
|
// console.log('上传总数', sum)
|
|
|
|
|
// console.log('要上传文件数量', sumbefore.value)
|
|
|
|
|
if (sumbefore.value !== sum && sumbefore.value !== 0 && sum !== 0) {
|
|
|
|
|
// console.log('要上传文件数量不等于上传总数时等待',uploading.value)
|
|
|
|
|
uploading.value = true
|
|
|
|
|
} else if (sum == sumbefore.value && sumbefore.value > 0 && sum > 0) {
|
|
|
|
|
// console.log('要上传文件数量等于上传总数 刷新页面并给出提示')
|
|
|
|
|
if (failedUploadsCount.value > 0) {
|
|
|
|
|
ElMessageBox.alert(
|
|
|
|
|
// 使用错误信息作为提示内容
|
|
|
|
|
`文件名为:${failedAttachmentsName.value.join(' / ')}上传失败`,
|
|
|
|
|
`文件格式不正确或网络问题 请您稍后再试`,
|
|
|
|
|
{
|
|
|
|
|
dangerouslyUseHTMLString: false,
|
|
|
|
|
confirmButtonText: '知道了',
|
|
|
|
|
center: true
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
reload()
|
|
|
|
|
uploading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// /** 删除子项操作 */
|
|
|
|
|
// const onDeleteItem = (index) => {
|
|
|
|
|
// if (formData.value.deliverOrderSubs.length == 1) {
|
|
|
|
|
// message.warning('发货清单至少存在一条数据')
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// formData.value.deliverOrderSubs.splice(index, 1)
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// const onDeleteItem2 = (index) => {
|
|
|
|
|
// formData.value.deliverOrderOtherSubs.splice(index, 1)
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// 删除附件
|
|
|
|
|
const handleDeleteAttachment = async (index, type) => {
|
|
|
|
|
const deletedAttachments = formData.value.attachments.splice(index, 1)
|
|
|
|
|
for (let i = 0; i < deletedAttachments.length; i++) {
|
|
|
|
|
const attachment = deletedAttachments[i]
|
|
|
|
|
if (attachment.id) {
|
|
|
|
|
// 清理已上传文件
|
|
|
|
|
await deleteFileLogic(attachment.id)
|
|
|
|
|
}
|
|
|
|
|
// 清理待上传文件
|
|
|
|
|
attachmentUploadFiles.value = attachmentUploadFiles.value.filter((file1) => {
|
|
|
|
|
return file1.name != attachment.name
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 下载文件
|
|
|
|
|
const downloadAttachment = async (name, url) => {
|
|
|
|
|
const data = await downloadFile(url)
|
|
|
|
|
download.any(data, name)
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|
</style>
|
|
|
|
|
<style scoped></style>
|
|
|
|
|