Commit e99e4d1a by liangzhen

暂存

1 parent 75be11c6
......@@ -30,6 +30,9 @@ axios.interceptors.request.use(config => {
if(config.url.indexOf('oss/downloadObject')!='-1'){
config.headers["Content-Type"] ='application/x-www-form-urlencoded'
}
// else if(config.url.indexOf('oss/upload')!='-1'){
// config.headers["Content-Type"] ='application/form-data'
// }
// config.headers.token = JSON.parse(localStorage.getItem('token')).token;
......
......@@ -175,7 +175,7 @@
</el-table-column>
<el-table-column label="附加解释材料" width="400">
<template slot-scope="scope" v-if="scope.row.confirmStatus == '1'&&scope.row.fileId">
{{
{{
scope.row.fileName
}} <el-button @click="handleClickXZ(scope.row)">下载</el-button>
</template>
......@@ -611,19 +611,19 @@ export default {
this.file = event.target.files[0];
},
submitFile(row) {
this.$message("上传还没做");
return;
// return;
console.log(row);
if (this.file) {
const formData = new FormData();
formData.append("file", this.file);
formData.append("prjId", this.checkedList[0].projectId);
formData.append("typeCode", row.typeCode);
// formData.append("prjId", this.checkedList[0].projectId);
// formData.append("typeCode", row.typeCode);
ossupload(formData)
.then((response) => {
console.log(response);
this.$set(row, "fileName", response.data.fileName);
this.$set(row, "fileId", response.data.fileId);
})
.catch((error) => {
console.error(error);
......
......@@ -242,7 +242,8 @@ export default {
data() {
return {
listData: {},
qdtableData: [],
qdtableData: JSON.parse(JSON.stringify(MaterialsList())),
tableDataNew:MaterialsList(),
xxtableData:[],
showButton: true,
ruleForm: {
......@@ -312,9 +313,28 @@ export default {
console.log(res[0], res[1], "2222222");
this.listData = res[0].data.records[0];
this.qdtableData = res[1].data.records;
this.qdtableData.forEach((item) => {
this.$set(item, "batchtype", "开发、实施类");
});
this.qdtableData=this.tableDataNew
if (res[1].data.records.length > 0) {
this.qdtableData = this.qdtableData
.concat(res.data.records)
.reduce((accumulator, currentObj) => {
const existingObj = accumulator.find(
(obj) => obj.typeCode == currentObj.typeCode
);
if (existingObj) {
Object.assign(existingObj, currentObj);
} else {
accumulator.push(currentObj);
}
return accumulator;
}, []);
console.log( this.tableDataQD,' mergedArray mergedArray mergedArray')
// this.tableDataQD.forEach((item) => {
// // this.$set(item, "batchtype", "开发、实施类");
// });
}
});
},
......
......@@ -205,6 +205,7 @@
active-text="无异议"
inactive-text="有异议"
@change="controlSwitch($event, scope.row)"
disabled
>
<template v-slot:active>
<span>开启</span>
......@@ -216,14 +217,14 @@
</template>
</el-table-column>
<el-table-column label="解释批注" width="200">
<template slot-scope="scope">
<template slot-scope="scope" v-if="scope.row.confirmStatus=='1'">
<el-input v-model="scope.row.feedback"></el-input>
</template>
</el-table-column>
<el-table-column label="附加解释材料" prop="fileId" width="400">
<template slot-scope="scope">
<template slot-scope="scope" v-if="scope.row.confirmStatus=='1'">
<input type="file" @change="handleFileUpload" />
<button @click="submitFile(scope.row)">上传</button>
<button @click="submitFile(scope.row,'fileId')">上传</button>
</template>
</el-table-column>
<el-table-column
......@@ -231,10 +232,11 @@
prop="rectificationStatus"
width="200"
>
<template slot-scope="scope">
<template slot-scope="scope" v-if="scope.row.confirmStatus=='1'">
<el-select
v-model="scope.row.appealStatus"
placeholder="请选择"
disabled
>
<el-option label="请选择" value=""></el-option>
<el-option label="未申诉" :value="0"></el-option>
......@@ -246,18 +248,18 @@
</el-table-column>
<el-table-column
label="上传整改材料"
prop="rectificationStatus"
prop="zgFileId"
width="400"
>
<template slot-scope="scope">
<template slot-scope="scope" v-if="scope.row.confirmStatus=='1'">
<input type="file" @change="handleFileUpload" />
<button @click="submitFile(scope.row)">上传</button>
<button @click="submitFile(scope.row,'zgFileId')">上传</button>
</template>
</el-table-column>
<el-table-column label="情况说明" prop="zgqkFileId" width="400">
<template slot-scope="scope">
<template slot-scope="scope" v-if="scope.row.confirmStatus=='1'">
<input type="file" @change="handleFileUpload" />
<button @click="submitFile(scope.row)">上传</button>
<button @click="submitFile(scope.row,'zgqkFileId')">上传</button>
</template>
</el-table-column>
<el-table-column
......@@ -265,7 +267,7 @@
prop="rectificationStatus"
width="200"
>
<template slot-scope="scope">
<template slot-scope="scope" v-if="scope.row.confirmStatus=='1'">
<el-select
v-model="scope.row.rectificationStatus"
placeholder="请选择"
......@@ -340,6 +342,7 @@
active-text="无异议"
inactive-text="有异议"
@change="controlSwitch($event, scope.row)"
disabled
>
<template v-slot:active>
<span>开启</span>
......@@ -352,24 +355,26 @@
</el-table-column>
<el-table-column label="解释批注" width="200">
<template slot-scope="scope">
<el-input v-model="scope.row.feedback"></el-input>
<el-input v-model="scope.row.feedback" disabled></el-input>
</template>
</el-table-column>
<el-table-column label="附加解释材料" prop="fileId" width="400">
<template slot-scope="scope">
<input type="file" @change="handleFileUpload" />
<button @click="submitFile(scope.row)">上传</button>
</template>
<template slot-scope="scope" v-if="scope.row.confirmStatus == '1'&&scope.row.fileId">
{{
scope.row.fileName
}} <el-button @click="handleClickXZ(scope.row)">下载</el-button>
</template>
</el-table-column>
<el-table-column
label="复核情况"
prop="rectificationStatus"
width="200"
>
<template slot-scope="scope">
<template slot-scope="scope" v-if="scope.row.confirmStatus == '1'">
<el-select
v-model="scope.row.appealStatus"
placeholder="请选择"
disabled
>
<el-option label="请选择" value=""></el-option>
<el-option label="未申诉" :value="0"></el-option>
......@@ -381,19 +386,21 @@
</el-table-column>
<el-table-column
label="上传整改材料"
prop="rectificationStatus"
prop="zgFileId"
width="400"
>
<template slot-scope="scope">
<input type="file" @change="handleFileUpload" />
<button @click="submitFile(scope.row)">上传</button>
</template>
<template slot-scope="scope" v-if="scope.row.confirmStatus == '1'&&scope.row.fileId">
{{
scope.row.fileName
}} <el-button @click="handleClickXZ(scope.row)">下载</el-button>
</template>
</el-table-column>
<el-table-column label="情况说明" prop="zgqkFileId" width="400">
<template slot-scope="scope">
<input type="file" @change="handleFileUpload" />
<button @click="submitFile(scope.row)">上传</button>
</template>
<template slot-scope="scope" v-if="scope.row.confirmStatus == '1'&&scope.row.fileId">
{{
scope.row.fileName
}} <el-button @click="handleClickXZ(scope.row)">下载</el-button>
</template>
</el-table-column>
</el-table>
</div>
......@@ -412,7 +419,8 @@ import {
wtssSelectificationVerification,
bcrectificationVerification,
tjrectificationVerification,
ossupload
ossupload,
downloadObject
} from "@/api/index";
export default {
data() {
......@@ -690,30 +698,50 @@ export default {
console.log("来了么");
this.file = event.target.files[0];
},
submitFile(row) {
this.$message("上传还没做");
return;
submitFile(row,type) {
// return;
console.log(row);
if (this.file) {
const formData = new FormData();
formData.append("file", this.file);
formData.append("prjId", this.checkedList[0].projectId);
formData.append("typeCode", row.typeCode);
// formData.append("prjId", this.checkedList[0].projectId);
// formData.append("typeCode", row.typeCode);
ossupload(formData)
.then((response) => {
console.log(response);
this.$set(row, "fileName", response.data.fileName);
this.file =[]
this.$set(row, type, response.data.fileId );
})
.catch((error) => {
console.error(error);
});
}else{
this.$message('请先选择文件')
}
},
closed() {
console.log("关闭");
this.handleSelectionChange();
},
async handleClickXZ(scope) {
console.log(scope.fileId);
let response = await downloadObject({
fileId: scope.fileId * 1,
});
let blob = new Blob([response]);
if ("download" in document.createElement("a")) {
let elink = document.createElement("a");
elink.download = scope.fileName;
elink.style.display = "none";
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href); // 释放URL 对象
document.body.removeChild(elink);
}
},
},
};
</script>
......
......@@ -242,8 +242,8 @@
<el-table-column label="材料类别" prop="batchtype"> </el-table-column>
<el-table-column prop="typeText" label="资料类型"> </el-table-column>
<el-table-column prop="fileName" label="资料名称">
<template slot-scope="scope">
<el-button @click="handleClickXZ(scope.row)">{{scope.row.fileName}}</el-button>
<template slot-scope="scope" v-if="scope.row.fileName">
{{scope.row.fileName}}&nbsp;&nbsp;<el-button @click="handleClickXZ(scope.row)">下载</el-button>
</template>
</el-table-column>
......@@ -435,10 +435,6 @@ export default {
// });
}
// this.tableDataQD.forEach((item) => {
// this.$set(item, "batchtype", "开发、实施类");
// });
// this.total = res.data.total * 1;
},
//详情
async detailsForm() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!