|
@@ -0,0 +1,133 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-descriptions title="基础信息" border>
|
|
|
+ <el-descriptions-item label="商标注册号">{{
|
|
|
+ updateInfo.logoRegistrationNumber
|
|
|
+ }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="申请人">{{
|
|
|
+ updateInfo.applicant
|
|
|
+ }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="联系方式">{{
|
|
|
+ updateInfo.contactDetails
|
|
|
+ }}</el-descriptions-item>
|
|
|
+ <!-- 可以根据需要添加更多的商标信息展示 -->
|
|
|
+ </el-descriptions>
|
|
|
+
|
|
|
+ <el-form :model="form" label-width="auto" style="margin-top: 2rem">
|
|
|
+ <el-form-item class="form-item" label="回执文件">
|
|
|
+ <el-upload
|
|
|
+ drag
|
|
|
+ multiple
|
|
|
+ :file-list="fileList"
|
|
|
+ style="width: 500px"
|
|
|
+ :http-request="handleUploadChange"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ >
|
|
|
+ <el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
|
+ <div class="el-upload__text">上传附件</div>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <div class="button-container">
|
|
|
+ <el-button type="primary" @click="onSubmit">提交</el-button>
|
|
|
+ <el-button @click="onReset">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import { reactive, ref, defineProps } from "vue";
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
+import { postCreate, postFileUpload } from "@/api";
|
|
|
+
|
|
|
+const emit = defineEmits(["handleUpload"]);
|
|
|
+
|
|
|
+const props = defineProps<{
|
|
|
+ updateInfo: any;
|
|
|
+ path: string;
|
|
|
+}>();
|
|
|
+
|
|
|
+const form = reactive({
|
|
|
+ annexes: [],
|
|
|
+});
|
|
|
+
|
|
|
+const fileList = ref<any[]>([]);
|
|
|
+const files = ref<any[]>([]);
|
|
|
+
|
|
|
+const handleUploadChange = async (option: any) => {
|
|
|
+ try {
|
|
|
+ const file = new FormData();
|
|
|
+ file.append("file", option.file);
|
|
|
+ const res = await postFileUpload(file); // 实际的上传逻辑
|
|
|
+ files.value.push(res); // 保存上传的文件信息
|
|
|
+ fileList.value.push(option.file); // 将文件添加到显示列表
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error("文件上传失败");
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const handleRemove = (file: any) => {
|
|
|
+ const fileIndexOf = files.value.findIndex(
|
|
|
+ (item: { uuid: any }) => item.uuid === file.uid
|
|
|
+ );
|
|
|
+
|
|
|
+ if (fileIndexOf !== -1) {
|
|
|
+ files.value.splice(fileIndexOf, 1); // 从 files 中删除该文件
|
|
|
+ }
|
|
|
+
|
|
|
+ const fileListIndex = fileList.value.indexOf(file);
|
|
|
+ if (fileListIndex !== -1) {
|
|
|
+ fileList.value.splice(fileListIndex, 1); // 从 fileList 中删除该文件
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const onSubmit = async () => {
|
|
|
+ if (files.value.length === 0) {
|
|
|
+ ElMessage.error("请上传至少一个回执文件!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const fileList = files.value.map((item: { uuid: any }) => item.uuid)
|
|
|
+
|
|
|
+ const data = {
|
|
|
+ id: props.updateInfo.id,
|
|
|
+ annexes: [...fileList, ...props.updateInfo.annexes]
|
|
|
+ };
|
|
|
+
|
|
|
+ try {
|
|
|
+ const response = (await postCreate(
|
|
|
+ data,
|
|
|
+ props.path
|
|
|
+ )) as unknown as any;
|
|
|
+ if (response.code === 200) {
|
|
|
+ ElMessage.success("回执文件提交成功!");
|
|
|
+ resetForm();
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error("提交失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ emit("handleUpload");
|
|
|
+};
|
|
|
+
|
|
|
+const resetForm = () => {
|
|
|
+ form.annexes = [];
|
|
|
+ files.value = [];
|
|
|
+ fileList.value = [];
|
|
|
+};
|
|
|
+
|
|
|
+const onReset = () => {
|
|
|
+ emit("handleUpload");
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.button-container {
|
|
|
+ width: 1080px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end; /* 将按钮固定在右侧 */
|
|
|
+}
|
|
|
+</style>
|