<template>
|
<div>
|
<el-dialog
|
title="上传"
|
v-model="dialogVisitable"
|
width="400px"
|
@close="cancel"
|
>
|
<div class="upload-container">
|
<div class="form-container">
|
<div class="title">生产前</div>
|
<fileUpload
|
:statusType="0"
|
ref="beforeProductionRef"
|
:fileSize="1024"
|
:fileType="['mp3', 'mp4', 'avi', 'mov', 'mkv']"
|
:limit="10"
|
:drag="false"
|
v-model:modelValue="beforeModelValue"
|
>
|
</fileUpload>
|
</div>
|
<div class="form-container">
|
<div class="title">生产后</div>
|
<fileUpload
|
:statusType="1"
|
ref="afterProductionRef"
|
:fileSize="1024"
|
:fileType="['mp3', 'mp4', 'avi', 'mov', 'mkv']"
|
:limit="10"
|
:drag="false"
|
v-model:modelValue="afterModelValue"
|
>
|
</fileUpload>
|
</div>
|
<div class="form-container">
|
<div class="title">生产问题</div>
|
<fileUpload
|
:statusType="2"
|
ref="issueProductionRef"
|
:fileSize="1024"
|
:fileType="['mp3', 'mp4', 'avi', 'mov', 'mkv']"
|
:limit="10"
|
:drag="false"
|
v-model:modelValue="issueModelValue"
|
>
|
</fileUpload>
|
</div>
|
</div>
|
<template #footer>
|
<div class="dialog-footer">
|
<el-button @click="cancel">取消</el-button>
|
<el-button type="primary" @click="submitForm">保存</el-button>
|
</div>
|
</template>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script setup>
|
import { reactive, ref } from "vue";
|
import {ElMessage} from "element-plus";
|
import fileUpload from "@/components/FileUpload/index.vue";
|
import {uploadInspectionTask} from "@/api/inspectionManagement/index.js";
|
|
const emit = defineEmits(['closeDia']);
|
const dialogVisitable = ref(false);
|
const { proxy } = getCurrentInstance()
|
const beforeModelValue = ref([]);
|
const afterModelValue = ref([]);
|
const issueModelValue = ref([]);
|
const beforeProductionRef = ref(null);
|
const afterProductionRef = ref(null);
|
const issueProductionRef = ref(null);
|
|
const submitForm = async () => {
|
let arr = [];
|
if (beforeModelValue.value.length > 0) {
|
arr.push(...beforeModelValue.value);
|
}
|
if (afterModelValue.value.length > 0) {
|
arr.push(...afterModelValue.value);
|
}
|
if (issueModelValue.value.length > 0) {
|
arr.push(...issueModelValue.value);
|
}
|
// 提交数据
|
infoData.value.storageBlobDTO = arr;
|
await uploadInspectionTask({...infoData.value});
|
cancel()
|
ElMessage.success("提交成功");
|
};
|
const infoData = ref(null);
|
// 打开弹框
|
const openDialog = async (row) => {
|
infoData.value = row;
|
dialogVisitable.value = true;
|
};
|
// 关闭合并表单
|
const cancel = () => {
|
proxy.resetForm("formRef");
|
dialogVisitable.value = false;
|
emit("closeDia");
|
};
|
defineExpose({ openDialog });
|
</script>
|
|
<style scoped lang="scss">
|
.upload-container {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
padding: 20px;
|
border: 1px solid #dcdfe6;
|
box-sizing: border-box;
|
.form-container {
|
flex: 1;
|
width: 100%;
|
margin-bottom: 20px;
|
}
|
}
|
.title {
|
font-size: 14px;
|
color: #165dff;
|
line-height: 20px;
|
font-weight: 600;
|
padding-left: 10px;
|
position: relative;
|
margin: 6px 0;
|
}
|
.title::before {
|
content: "";
|
position: absolute;
|
left: 0;
|
top: 3px; /* 调整垂直位置 */
|
width: 4px; /* 小数条宽度 */
|
height: 14px; /* 小数条高度 */
|
background-color: #165dff; /* 蓝色 */
|
}
|
</style>
|