mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-19 07:46:46 +08:00
测评上传
This commit is contained in:
@@ -414,7 +414,7 @@
|
||||
</div>
|
||||
<div class="bg_body">
|
||||
<div>上传结果</div>
|
||||
<div style="margin: 25px 0 0 24px;">上传的测评报告总文件数200个,成功190个,失败10个;<br/>上传结果<span @click="tan" style="color: #4ea6ff;cursor: pointer;">请下载</span>查看!</div>
|
||||
<div style="margin: 25px 0 0 24px;">上传的测评报告总文件数{{totalNumber.totalEntries}}个,成功{{totalNumber.successfulEntries}}个,失败{{totalNumber.failedEntries}}个;<br/>上传结果<span @click="failedDownload" style="color: #4ea6ff;cursor: pointer;">请下载</span>查看!</div>
|
||||
<div class="bg_footer" style="margin-left: 90px;">
|
||||
<div class="btn btn6" @click="of_results">
|
||||
<div class="btnText">取消</div>
|
||||
@@ -693,6 +693,7 @@ import { message } from "ant-design-vue";
|
||||
const userInfo = computed(() => store.state.userInfo);
|
||||
const router = useRouter();
|
||||
const state = reactive({
|
||||
totalNumber: {},
|
||||
stateType:'',
|
||||
uploadDownLoad: false,
|
||||
uploadDownId: '',
|
||||
@@ -901,7 +902,7 @@ import { message } from "ant-design-vue";
|
||||
key: "organizationalDepartment",
|
||||
className: "h",
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
width: 150,
|
||||
customRender: ({ text }) => {
|
||||
return text ? text : "";
|
||||
},
|
||||
@@ -912,7 +913,7 @@ import { message } from "ant-design-vue";
|
||||
key: "updateTime",
|
||||
className: "h",
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: "权限",
|
||||
@@ -920,7 +921,7 @@ import { message } from "ant-design-vue";
|
||||
key: "permission",
|
||||
className: "h",
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
width: 200,
|
||||
customRender: ({ text }) => {
|
||||
if(text == null){
|
||||
return ""
|
||||
@@ -969,7 +970,7 @@ import { message } from "ant-design-vue";
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: "20%",
|
||||
width: "150",
|
||||
dataIndex: "id",
|
||||
key: "id",
|
||||
align: "center",
|
||||
@@ -1071,6 +1072,7 @@ import { message } from "ant-design-vue";
|
||||
};
|
||||
//报告上传
|
||||
const bgupload = () => {
|
||||
state.uploadId = ''
|
||||
state.valueAll = []
|
||||
state.bg_check = true;
|
||||
state.formData = {}
|
||||
@@ -1107,8 +1109,9 @@ import { message } from "ant-design-vue";
|
||||
const resultsUp = () => {
|
||||
state.bg_results = false
|
||||
}
|
||||
const tan = () => {
|
||||
const failedDownload = () => {
|
||||
console.log('aaa')
|
||||
window.open(`/activityApi/evaluation/download?id=${state.totalNumber.failedIds}`);
|
||||
}
|
||||
const reportUpload = async () => {
|
||||
if(!state.formData.evaluationName){
|
||||
@@ -1188,9 +1191,9 @@ import { message } from "ant-design-vue";
|
||||
message.error("图片大小超过2MB!");
|
||||
return false;
|
||||
}
|
||||
const formDatas = new FormData();
|
||||
formDatas.append("file", file);
|
||||
uploadImage(formDatas).then((res) => {
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
uploadImage(formData).then((res) => {
|
||||
if (res.status === 200) {
|
||||
state.formData.imageUrl = res.data.split('Path:')[1];
|
||||
}
|
||||
@@ -1214,19 +1217,30 @@ import { message } from "ant-design-vue";
|
||||
return false;
|
||||
}
|
||||
state.uploadDownLoad = true
|
||||
const formDatas = new FormData();
|
||||
formDatas.append("file", file);
|
||||
if(state.uploadId){
|
||||
formDatas.append("pid", state.uploadId);
|
||||
formDatas.append("uploadName", userInfo.value.realName);
|
||||
formDatas.append("createId", userInfo.value.userId);
|
||||
formDatas.append("createName", userInfo.value.realName);
|
||||
}else{
|
||||
formDatas.append("uploadName", userInfo.value.realName);
|
||||
formDatas.append("createId", userInfo.value.userId);
|
||||
formDatas.append("createName", userInfo.value.realName);
|
||||
// const formData = new FormData();
|
||||
const formData = {
|
||||
file: file
|
||||
}
|
||||
await importList(formDatas).then((res)=>{
|
||||
// formData.append("file", file);
|
||||
if(state.uploadId){
|
||||
formData.pid= state.uploadId,
|
||||
formData.uploadName=userInfo.value.realName,
|
||||
formData.createId= userInfo.value.userId,
|
||||
formData.createName= userInfo.value.realName
|
||||
// formData.append("pid", state.uploadId);
|
||||
// formData.append("uploadName", userInfo.value.realName);
|
||||
// formData.append("createId", userInfo.value.userId);
|
||||
// formData.append("createName", userInfo.value.realName);
|
||||
}else{
|
||||
// formData.append("uploadName", userInfo.value.realName);
|
||||
// formData.append("createId", userInfo.value.userId);
|
||||
// formData.append("createName", userInfo.value.realName);
|
||||
// pid: state.uploadId,
|
||||
formData.uploadName=userInfo.value.realName,
|
||||
formData.createId= userInfo.value.userId,
|
||||
formData.createName= userInfo.value.realName
|
||||
}
|
||||
boeRequest('/activityApi/evaluation/import post formData',formData).then((res)=>{
|
||||
if(res.code === 200){
|
||||
if(state.stateType == "application/pdf"){
|
||||
state.idValue = res.data.map(item=>item.id)
|
||||
@@ -1234,16 +1248,31 @@ import { message } from "ant-design-vue";
|
||||
}else{
|
||||
state.idValue = res.data.evaluationDetailList.map(item=>item.id)
|
||||
state.valueAll = res.data.evaluationDetailList
|
||||
state.totalNumber = res.data
|
||||
}
|
||||
console.log(state.valueAll,'state.valueAll')
|
||||
state.uploadDownLoad = false
|
||||
}
|
||||
}).catch((err)=>{
|
||||
state.uploadDownLoad = false
|
||||
console.log(err,'err')
|
||||
})
|
||||
// await importList(formData).then((res)=>{
|
||||
// if(res.code === 200){
|
||||
// if(state.stateType == "application/pdf"){
|
||||
// state.idValue = res.data.map(item=>item.id)
|
||||
// state.valueAll = res.data
|
||||
// }else{
|
||||
// state.idValue = res.data.evaluationDetailList.map(item=>item.id)
|
||||
// state.valueAll = res.data.evaluationDetailList
|
||||
// state.totalNumber = res.data
|
||||
// }
|
||||
// console.log(state.valueAll,'state.valueAll')
|
||||
// state.uploadDownLoad = false
|
||||
// }
|
||||
// }).catch((err)=>{
|
||||
// state.uploadDownLoad = false
|
||||
// console.log(err,'err')
|
||||
// })
|
||||
// try {
|
||||
// const response = await axios.post('/activityApi/evaluation/import', formDatas);
|
||||
// const response = await axios.post('/activityApi/evaluation/import', formData);
|
||||
// const jsonData = JSONbig({ storeAsString: true }).parse(response.data);
|
||||
|
||||
// if (jsonData.code === 200) {
|
||||
@@ -1551,7 +1580,7 @@ import { message } from "ant-design-vue";
|
||||
showUpload,
|
||||
of_results,
|
||||
resultsUp,
|
||||
tan,
|
||||
failedDownload,
|
||||
of_setting,
|
||||
settingUp,
|
||||
// of_edit,
|
||||
|
||||
Reference in New Issue
Block a user