fix: 合同管理 文件支持上传多个
This commit is contained in:
parent
99e49d7150
commit
197617997d
@ -2,12 +2,12 @@
|
||||
NODE_ENV = 'development'
|
||||
|
||||
# 本地环境接口地址(/api/index.ts文件中使用)
|
||||
VITE_API_URL = 'http://192.168.34.155:6688'
|
||||
# VITE_API_URL = 'http://192.168.34.155:6688'
|
||||
# VITE_API_URL = 'http://183.63.230.59:6090'
|
||||
# VITE_API_URL = 'http://2xliv7gs.shenzhuo.vip:55296'
|
||||
VITE_WPAPI_URL = "http://jxjzw.zhgdyun.com:8081"
|
||||
# VITE_API_URL = "http://jxjzw.zhgdyun.com:9013"
|
||||
# VITE_API_URL = 'https://xmglcs.hyjgxt.cn:6090'
|
||||
VITE_API_URL = 'https://xmglcs.hyjgxt.cn:6090'
|
||||
|
||||
# 上传
|
||||
# VITE_ULD_API_URL = 'http://192.168.34.155:8012/onlinePreview?url='
|
||||
|
||||
@ -1,16 +1,17 @@
|
||||
# 线上环境
|
||||
NODE_ENV = "production"
|
||||
|
||||
# 线上环境接口地址(easymock)
|
||||
# VITE_API_URL = "http://139.9.66.234:6688"
|
||||
# VITE_API_URL = 'http://10.75.253.12:6090'
|
||||
VITE_API_URL = 'https://xmgl.hyjgxt.cn:6090'
|
||||
# VITE_API_URL = 'http://183.63.230.59:6090'
|
||||
# VITE_API_URL = "http://jxjzw.zhgdyun.com:9013"
|
||||
VITE_WPAPI_URL = "http://jxjzw.zhgdyun.com:8081"
|
||||
# VITE_API_URL = "http://101.43.164.214:6688"
|
||||
# VITE_API_URL = "https://wx.antjg.com:6081/"
|
||||
|
||||
# 打包
|
||||
VITE_ULD_API_URL = 'http://jxjzw.zhgdyun.com:8012/onlinePreview?url='
|
||||
|
||||
# 线上环境
|
||||
NODE_ENV = "production"
|
||||
|
||||
# 线上环境接口地址(easymock)
|
||||
# VITE_API_URL = "http://139.9.66.234:6688"
|
||||
# VITE_API_URL = 'http://10.75.253.12:6090'
|
||||
# VITE_API_URL = 'https://xmgl.hyjgxt.cn:6090'
|
||||
VITE_API_URL = "https://hyjgxt.cn:6090"
|
||||
# VITE_API_URL = 'http://183.63.230.59:6090'
|
||||
# VITE_API_URL = "http://jxjzw.zhgdyun.com:9013"
|
||||
VITE_WPAPI_URL = "http://jxjzw.zhgdyun.com:8081"
|
||||
# VITE_API_URL = "http://101.43.164.214:6688"
|
||||
# VITE_API_URL = "https://wx.antjg.com:6081/"
|
||||
|
||||
# 打包
|
||||
VITE_ULD_API_URL = 'http://jxjzw.zhgdyun.com:8012/onlinePreview?url='
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<template #centerContent>
|
||||
<div style="width: 70%; height: 100%; margin: 0 auto">
|
||||
<div style="width: 70%; height: 100%; margin: 0 auto; overflow: auto">
|
||||
<el-form class="diaForm" :rules="formRules" :model="formData" ref="ruleFormRef" label-width="160px">
|
||||
<el-form-item label="费用类型:" prop="type">
|
||||
<el-input v-model="formData.type" placeholder="请输入" />
|
||||
@ -136,7 +136,6 @@
|
||||
:action="`${baseUrl}` + '/xmgl/file/upload'"
|
||||
:on-remove="e => onRemove(e, 1)"
|
||||
multiple
|
||||
:limit="1"
|
||||
:on-success="e => uploadSuccess(e, 1)"
|
||||
:on-preview="onPreview"
|
||||
style="width: 100%"
|
||||
@ -153,7 +152,6 @@
|
||||
:action="`${baseUrl}` + '/xmgl/file/upload'"
|
||||
:on-remove="e => onRemove(e, 2)"
|
||||
multiple
|
||||
:limit="1"
|
||||
:on-success="e => uploadSuccess(e, 2)"
|
||||
:on-preview="onPreview"
|
||||
style="width: 100%"
|
||||
@ -170,7 +168,6 @@
|
||||
:action="`${baseUrl}` + '/xmgl/file/upload'"
|
||||
:on-remove="e => onRemove(e, 3)"
|
||||
multiple
|
||||
:limit="1"
|
||||
:on-success="e => uploadSuccess(e, 3)"
|
||||
:on-preview="onPreview"
|
||||
style="width: 100%"
|
||||
@ -548,27 +545,28 @@ const onPreview = (file: any) => {
|
||||
};
|
||||
const uploadSuccess = (response: any, index: any) => {
|
||||
ElMessage.success("上传成功");
|
||||
let file = { name: response.result.originalFilename, url: response.result.url };
|
||||
if (index == 1) {
|
||||
formData.value.contractFile = response.result.url;
|
||||
fileList.value = [{ name: response.result.originalFilename, url: response.result.url }];
|
||||
fileList.value.push(file);
|
||||
formData.value.contractFile = fileList.value.map(item => item.url).join(",");
|
||||
} else if (index == 2) {
|
||||
formData.value.suggestFile = response.result.url;
|
||||
fileList2.value = [{ name: response.result.originalFilename, url: response.result.url }];
|
||||
fileList2.value.push(file);
|
||||
formData.value.suggestFile = fileList2.value.map(item => item.url).join(",");
|
||||
} else if (index == 3) {
|
||||
formData.value.approvalFile = response.result.url;
|
||||
fileList3.value = [{ name: response.result.originalFilename, url: response.result.url }];
|
||||
fileList3.value.push(file);
|
||||
formData.value.approvalFile = fileList3.value.map(item => item.url).join(",");
|
||||
}
|
||||
};
|
||||
const onRemove: UploadProps["onRemove"] = (file, index) => {
|
||||
if (index == 1) {
|
||||
formData.value.contractFile = "";
|
||||
fileList.value = reactive([]);
|
||||
fileList.value.splice(index, 1);
|
||||
formData.value.contractFile = fileList.value.map(item => item.url).join(",");
|
||||
} else if (index == 2) {
|
||||
formData.value.suggestFile = "";
|
||||
fileList2.value = reactive([]);
|
||||
fileList2.value.splice(index, 1);
|
||||
formData.value.suggestFile = fileList2.value.map(item => item.url).join(",");
|
||||
} else if (index == 3) {
|
||||
formData.value.approvalFile = "";
|
||||
fileList3.value = reactive([]);
|
||||
fileList3.value.splice(index, 1);
|
||||
formData.value.approvalFile = fileList3.value.map(item => item.url).join(",");
|
||||
}
|
||||
};
|
||||
const otherUploadSuccess = (response: any) => {
|
||||
@ -600,14 +598,33 @@ const handleEdit = (row: any) => {
|
||||
console.log(row);
|
||||
formData.value = reactive({ ...row });
|
||||
title.value = "编辑";
|
||||
fileList.value = [];
|
||||
fileList2.value = [];
|
||||
fileList3.value = [];
|
||||
fileList4.value = [];
|
||||
if (row.contractFile) {
|
||||
fileList.value = [{ name: "文件", url: row.contractFile }];
|
||||
fileList.value = row.contractFile.split(",").map((item: any, index: any) => {
|
||||
return {
|
||||
name: "文件" + (index + 1),
|
||||
url: item
|
||||
};
|
||||
});
|
||||
}
|
||||
if (row.suggestFile) {
|
||||
fileList2.value = [{ name: "文件", url: row.suggestFile }];
|
||||
fileList2.value = row.suggestFile.split(",").map((item: any, index: any) => {
|
||||
return {
|
||||
name: "文件" + (index + 1),
|
||||
url: item
|
||||
};
|
||||
});
|
||||
}
|
||||
if (row.approvalFile) {
|
||||
fileList3.value = [{ name: "文件", url: row.approvalFile }];
|
||||
fileList3.value = row.approvalFile.split(",").map((item: any, index: any) => {
|
||||
return {
|
||||
name: "文件" + (index + 1),
|
||||
url: item
|
||||
};
|
||||
});
|
||||
}
|
||||
if (row.otherFile) {
|
||||
fileList4.value = row.otherFile.split(",").map((item: any, index: any) => {
|
||||
@ -640,6 +657,10 @@ const handleAddItem = () => {
|
||||
approvalFile: "",
|
||||
otherFile: ""
|
||||
});
|
||||
fileList.value = [];
|
||||
fileList2.value = [];
|
||||
fileList3.value = [];
|
||||
fileList4.value = [];
|
||||
visible.value = true;
|
||||
title.value = "新增";
|
||||
// formData.value = reactive({});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user