Commit 37ca0095 authored by 王李辉's avatar 王李辉

上传附件

parent 26cd1e8f
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
<van-field name="hdVideo1" label="隐患视频"> <van-field name="hdVideo1" label="隐患视频">
<template #input> <template #input>
<van-uploader v-model="uploaderVideo" /> <van-uploader v-model="uploaderVideo" accept="video/*" />
</template> </template>
</van-field> </van-field>
<van-field <van-field
...@@ -300,7 +300,7 @@ export default { ...@@ -300,7 +300,7 @@ export default {
}); });
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
if ((to.name != "choose-people")) { if (to.name != "choose-people") {
// 如果去的路由是 // 如果去的路由是
this.projectId = ""; // 所属工程 this.projectId = ""; // 所属工程
this.taskId = ""; this.taskId = "";
...@@ -386,6 +386,7 @@ export default { ...@@ -386,6 +386,7 @@ export default {
onSubmit(values) { onSubmit(values) {
console.log("submit", values); console.log("submit", values);
let formdata = new FormData(); let formdata = new FormData();
formdata.append("proId", this.projectId); formdata.append("proId", this.projectId);
formdata.append("hdRange", values.hdRange); formdata.append("hdRange", values.hdRange);
formdata.append("hdType", values.hdType); formdata.append("hdType", values.hdType);
...@@ -397,10 +398,15 @@ export default { ...@@ -397,10 +398,15 @@ export default {
formdata.append("dangerSource", values.dangerSource); formdata.append("dangerSource", values.dangerSource);
formdata.append("hdPosition", values.hdPosition); formdata.append("hdPosition", values.hdPosition);
formdata.append("hdDescribe", values.hdDescribe); formdata.append("hdDescribe", values.hdDescribe);
formdata.append("hdPicture1[]", values.hdPicture1);
formdata.append("hdVideo1[]", values.hdVideo1);
formdata.append("hdExpirationTime", values.hdExpirationTime); formdata.append("hdExpirationTime", values.hdExpirationTime);
formdata.append("rectificationUser", values.rectificationUser); formdata.append("rectificationUser", values.rectificationUser);
// 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
values.hdPicture1.forEach(item => {
formdata.append("hdPicture1[]", item.file);
});
values.hdVideo1.forEach(item => {
formdata.append("hdVideo1[]", item.file);
});
this.$toast.loading({ this.$toast.loading({
message: "提交中...", message: "提交中...",
forbidClick: true, forbidClick: true,
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
:rules="[{ required: true, message: '隐患整改详情描述不能为空' }]" :rules="[{ required: true, message: '隐患整改详情描述不能为空' }]"
/> />
<van-field name="uploader" label="整改照片"> <van-field name="uploader" label="整改照片" :rules="[{ required: true, message: '整改照片不能为空' }]">
<template #input> <template #input>
<van-uploader v-model="uploaderImg" /> <van-uploader v-model="uploaderImg" />
</template> </template>
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<van-field name="uploader2" label="整改视频"> <van-field name="uploader2" label="整改视频">
<template #input> <template #input>
<van-uploader v-model="uploaderVideo" /> <van-uploader v-model="uploaderVideo" accept="video/*" />
</template> </template>
</van-field> </van-field>
...@@ -145,8 +145,13 @@ export default { ...@@ -145,8 +145,13 @@ export default {
}); });
let formdata = new FormData(); let formdata = new FormData();
formdata.append("details", this.value); formdata.append("details", this.value);
// formdata.append("rePicture[]", values.uploader); // 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
// formdata.append("reVideo[]", values.uploader2); values.uploader.forEach(item => {
formdata.append("rePicture1[]", item.file);
});
values.uploader2.forEach(item => {
formdata.append("reVideo1[]", item.file);
});
// 判断保存的url // 判断保存的url
let url = `/rectification/add1/${this.taskId}`; let url = `/rectification/add1/${this.taskId}`;
if (this.taskName == "隐患整改(已退回)") { if (this.taskName == "隐患整改(已退回)") {
......
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
<van-field <van-field
name="uploader" name="uploader"
label="隐患复查照片" label="隐患复查照片"
:rules="[{ required: true, message: '隐患复查照片不能为空' }]"
> >
<template #input> <template #input>
<van-uploader v-model="uploaderImg" /> <van-uploader v-model="uploaderImg" />
...@@ -156,8 +157,12 @@ export default { ...@@ -156,8 +157,12 @@ export default {
}); });
let formdata = new FormData() let formdata = new FormData()
formdata.append('reviewResult', this.radio) formdata.append('reviewResult', this.radio)
// formdata.append('reviewPicture[]', values.uploader)
formdata.append('reviewDetails', values.reviewDetails) formdata.append('reviewDetails', values.reviewDetails)
// 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
values.uploader.forEach(item => {
formdata.append("reviewPicture1[]", item.file);
});
dangerReviewAdd(`/review/add1/${this.taskId}`,formdata) dangerReviewAdd(`/review/add1/${this.taskId}`,formdata)
.then(res => { .then(res => {
this.$toast.clear(); this.$toast.clear();
......
This diff is collapsed.
...@@ -67,6 +67,16 @@ ...@@ -67,6 +67,16 @@
> >
<van-col span="17">{{ riskMain.gradingMethod }}</van-col> <van-col span="17">{{ riskMain.gradingMethod }}</van-col>
</van-row> </van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title">定级方式(附件):</span></van-col
>
<van-col span="17">
<div class="enclosure" v-for="(item, index) in riskMain.riskFileList1" :key="index">
<a :href="item.filePath" target="_blank">{{item.fileName}}</a>
</div>
</van-col>
</van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="7" <van-col span="7"
><span class="field-title">技术措施:</span></van-col ><span class="field-title">技术措施:</span></van-col
...@@ -77,7 +87,11 @@ ...@@ -77,7 +87,11 @@
<van-col span="7" <van-col span="7"
><span class="field-title">技术措施(附件):</span></van-col ><span class="field-title">技术措施(附件):</span></van-col
> >
<van-col span="17">{{ riskMain.technicalMeasures }}</van-col> <van-col span="17">
<div class="enclosure" v-for="(item, index) in riskMain.riskFileList2" :key="index">
<a :href="item.filePath" target="_blank">{{item.fileName}}</a>
</div>
</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="7" <van-col span="7"
...@@ -89,7 +103,11 @@ ...@@ -89,7 +103,11 @@
<van-col span="7" <van-col span="7"
><span class="field-title">管理措施(附件):</span></van-col ><span class="field-title">管理措施(附件):</span></van-col
> >
<van-col span="17">{{ riskMain.managementMeasures }}</van-col> <van-col span="17">
<div class="enclosure" v-for="(item, index) in riskMain.riskFileList3" :key="index">
<a :href="item.filePath" target="_blank">{{item.fileName}}</a>
</div>
</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="7" <van-col span="7"
...@@ -101,7 +119,11 @@ ...@@ -101,7 +119,11 @@
<van-col span="7" <van-col span="7"
><span class="field-title">应急措施(附件):</span></van-col ><span class="field-title">应急措施(附件):</span></van-col
> >
<van-col span="17">{{ riskMain.emergencyMeasure }}</van-col> <van-col span="17">
<div class="enclosure" v-for="(item, index) in riskMain.riskFileList4" :key="index">
<a :href="item.filePath" target="_blank">{{item.fileName}}</a>
</div>
</van-col>
</van-row> </van-row>
</div> </div>
</van-cell-group> </van-cell-group>
......
...@@ -154,9 +154,9 @@ ...@@ -154,9 +154,9 @@
autosize autosize
placeholder="请输入" placeholder="请输入"
/> />
<van-field name="定级方式" label=" "> <van-field name="setRankModeFile" label=" ">
<template #input> <template #input>
<van-uploader v-model="setRankModeImg" /> <van-uploader v-model="setRankModeImg" accept="file"/>
</template> </template>
</van-field> </van-field>
...@@ -237,9 +237,9 @@ ...@@ -237,9 +237,9 @@
autosize autosize
placeholder="请输入" placeholder="请输入"
/> />
<van-field name="技术措施" label=" "> <van-field name="technologyFile" label=" ">
<template #input> <template #input>
<van-uploader v-model="technologyImg" /> <van-uploader v-model="technologyImg" accept="file"/>
</template> </template>
</van-field> </van-field>
...@@ -252,9 +252,9 @@ ...@@ -252,9 +252,9 @@
autosize autosize
placeholder="请输入" placeholder="请输入"
/> />
<van-field name="管理措施" label=" "> <van-field name="administrationFile" label=" ">
<template #input> <template #input>
<van-uploader v-model="administrationImg" /> <van-uploader v-model="administrationImg" accept="file"/>
</template> </template>
</van-field> </van-field>
...@@ -267,9 +267,9 @@ ...@@ -267,9 +267,9 @@
autosize autosize
placeholder="请输入" placeholder="请输入"
/> />
<van-field name="应急措施" label=" "> <van-field name="urgentFile" label=" ">
<template #input> <template #input>
<van-uploader v-model="urgentImg" /> <van-uploader v-model="urgentImg" accept="file"/>
</template> </template>
</van-field> </van-field>
...@@ -370,6 +370,20 @@ export default { ...@@ -370,6 +370,20 @@ export default {
formdata.append("managementMeasures", this.administration); formdata.append("managementMeasures", this.administration);
formdata.append("emergencyMeasure", this.urgent); formdata.append("emergencyMeasure", this.urgent);
// 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
values.setRankModeFile.forEach(item => { // 定级方式
formdata.append("risk1[]", item.file);
});
values.technologyFile.forEach(item => { // 技术措施
formdata.append("risk2[]", item.file);
});
values.administrationFile.forEach(item => { // 管理措施
formdata.append("risk3[]", item.file);
});
values.urgentFile.forEach(item => { // 应急措施
formdata.append("risk4[]", item.file);
});
this.$toast.loading({ this.$toast.loading({
message: "提交中...", message: "提交中...",
...@@ -520,7 +534,7 @@ export default { ...@@ -520,7 +534,7 @@ export default {
myRiskRank(){ myRiskRank(){
console.log(this.setRank); console.log(this.setRank);
if(this.setRank == ""){ if(this.setRank == ""){
this.$toast("请先选择风险源"); this.$toast("其他定级方式");
}else if(this.setRank == "其他定级方式"){ }else if(this.setRank == "其他定级方式"){
this.showRiskRank = true; this.showRiskRank = true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment