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

上传附件

parent 26cd1e8f
......@@ -214,7 +214,7 @@
<van-field name="hdVideo1" label="隐患视频">
<template #input>
<van-uploader v-model="uploaderVideo" />
<van-uploader v-model="uploaderVideo" accept="video/*" />
</template>
</van-field>
<van-field
......@@ -300,44 +300,44 @@ export default {
});
},
beforeRouteLeave(to, from, next) {
if ((to.name != "choose-people")) {
// 如果去的路由是
this.projectId = ""; // 所属工程
this.taskId = "";
this.projectName = "";
this.showProjectName = false;
this.columnsProjectName = [];
this.range = ""; //适用范围
this.showRange = false;
this.columnsRange = [];
this.type = ""; //隐患类型
this.showType = false;
this.columnsType = [];
this.dangerName = ""; //隐患项目名称
this.showDangerName = false;
this.columnsDangerName = [];
this.dangerNum = ""; //隐患项目编号
this.dangerLevel = ""; //隐患项目级别
this.findTime = ""; //隐患发现时间
this.showFindTime = false;
this.source = ""; // 风险源
this.showSource = false;
this.columnsSource = [];
this.source1 = ""; // 风险源第二个字段
this.showSource1 = false;
this.columnsSource1 = [];
this.location = ""; // 检查部位
this.describe = ""; // 隐患描述
this.uploaderImg = []; //图像上传
this.uploaderVideo = []; //视频上传
this.expireTime = ""; // 隐患到期时间
this.showExpireTime = false;
this.recPeople = "";
this.showRecPeople = false;
this.columnsRecPeople = [];
this.isShowreturnCause = false;
this.returnCause = ""; // 退回原因
}
if (to.name != "choose-people") {
// 如果去的路由是
this.projectId = ""; // 所属工程
this.taskId = "";
this.projectName = "";
this.showProjectName = false;
this.columnsProjectName = [];
this.range = ""; //适用范围
this.showRange = false;
this.columnsRange = [];
this.type = ""; //隐患类型
this.showType = false;
this.columnsType = [];
this.dangerName = ""; //隐患项目名称
this.showDangerName = false;
this.columnsDangerName = [];
this.dangerNum = ""; //隐患项目编号
this.dangerLevel = ""; //隐患项目级别
this.findTime = ""; //隐患发现时间
this.showFindTime = false;
this.source = ""; // 风险源
this.showSource = false;
this.columnsSource = [];
this.source1 = ""; // 风险源第二个字段
this.showSource1 = false;
this.columnsSource1 = [];
this.location = ""; // 检查部位
this.describe = ""; // 隐患描述
this.uploaderImg = []; //图像上传
this.uploaderVideo = []; //视频上传
this.expireTime = ""; // 隐患到期时间
this.showExpireTime = false;
this.recPeople = "";
this.showRecPeople = false;
this.columnsRecPeople = [];
this.isShowreturnCause = false;
this.returnCause = ""; // 退回原因
}
next();
},
......@@ -386,6 +386,7 @@ export default {
onSubmit(values) {
console.log("submit", values);
let formdata = new FormData();
formdata.append("proId", this.projectId);
formdata.append("hdRange", values.hdRange);
formdata.append("hdType", values.hdType);
......@@ -397,10 +398,15 @@ export default {
formdata.append("dangerSource", values.dangerSource);
formdata.append("hdPosition", values.hdPosition);
formdata.append("hdDescribe", values.hdDescribe);
formdata.append("hdPicture1[]", values.hdPicture1);
formdata.append("hdVideo1[]", values.hdVideo1);
formdata.append("hdExpirationTime", values.hdExpirationTime);
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({
message: "提交中...",
forbidClick: true,
......
......@@ -65,7 +65,7 @@
:rules="[{ required: true, message: '隐患整改详情描述不能为空' }]"
/>
<van-field name="uploader" label="整改照片">
<van-field name="uploader" label="整改照片" :rules="[{ required: true, message: '整改照片不能为空' }]">
<template #input>
<van-uploader v-model="uploaderImg" />
</template>
......@@ -73,7 +73,7 @@
<van-field name="uploader2" label="整改视频">
<template #input>
<van-uploader v-model="uploaderVideo" />
<van-uploader v-model="uploaderVideo" accept="video/*" />
</template>
</van-field>
......@@ -145,8 +145,13 @@ export default {
});
let formdata = new FormData();
formdata.append("details", this.value);
// formdata.append("rePicture[]", values.uploader);
// formdata.append("reVideo[]", values.uploader2);
// 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
values.uploader.forEach(item => {
formdata.append("rePicture1[]", item.file);
});
values.uploader2.forEach(item => {
formdata.append("reVideo1[]", item.file);
});
// 判断保存的url
let url = `/rectification/add1/${this.taskId}`;
if (this.taskName == "隐患整改(已退回)") {
......
......@@ -74,6 +74,7 @@
<van-field
name="uploader"
label="隐患复查照片"
:rules="[{ required: true, message: '隐患复查照片不能为空' }]"
>
<template #input>
<van-uploader v-model="uploaderImg" />
......@@ -156,8 +157,12 @@ export default {
});
let formdata = new FormData()
formdata.append('reviewResult', this.radio)
// formdata.append('reviewPicture[]', values.uploader)
formdata.append('reviewDetails', values.reviewDetails)
// 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
values.uploader.forEach(item => {
formdata.append("reviewPicture1[]", item.file);
});
dangerReviewAdd(`/review/add1/${this.taskId}`,formdata)
.then(res => {
this.$toast.clear();
......
......@@ -79,13 +79,29 @@
<van-col span="7"
><span class="field-title">隐患照片:</span></van-col
>
<van-col span="17">{{ hdReport.hdPicture }}</van-col>
<van-col span="17">
<div
class="detail_pic"
v-for="(item, index) in hdReport.hdPictureList"
:key="index"
>
<van-image width="100" height="100" :src="item.filePath" />
</div>
</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title">隐患视频:</span></van-col
>
<van-col span="17">{{ hdReport.hdVideo }}</van-col>
<van-col span="17">
<div
class="detail_video"
v-for="(item, index) in hdReport.hdVideoList"
:key="index"
>
<video :src="item.filePath"></video>
</div>
</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
......@@ -109,7 +125,7 @@
<div class="confirm-wrap" v-if="hdConfirm">
<p>隐患认定</p>
<van-cell-group inset >
<van-cell-group inset>
<van-row gutter="">
<van-col span="7"
><span class="field-title">隐患整改人:</span></van-col
......@@ -129,9 +145,7 @@
<van-col span="17">{{ hdConfirm.endTime }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title">意见:</span></van-col
>
<van-col span="7"><span class="field-title">意见:</span></van-col>
<van-col span="17">{{ hdConfirm.confirmOpinion }}</van-col>
</van-row>
......@@ -149,9 +163,13 @@
</div> -->
</div>
<div class="change-wrap" v-if="hdRectificationList.length>0">
<div class="change-wrap" v-if="hdRectificationList.length > 0">
<p>隐患整改</p>
<van-cell-group inset v-for="(item, index) in hdRectificationList" :key="index">
<van-cell-group
inset
v-for="(item, index) in hdRectificationList"
:key="index"
>
<van-row gutter="">
<van-col span="7"
><span class="field-title">整改详情描述:</span></van-col
......@@ -162,13 +180,29 @@
<van-col span="7"
><span class="field-title">隐患照片:</span></van-col
>
<van-col span="17">{{ item.rePicture }}</van-col>
<van-col span="17">
<div
class="detail_pic"
v-for="(itemTwo, index) in item.hdPictureList"
:key="index"
>
<van-image width="100" height="100" :src="itemTwo.filePath" />
</div>
</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title">隐患视频:</span></van-col
>
<van-col span="17">{{ item.reVideo }}</van-col>
<van-col span="17">
<div
class="detail_video"
v-for="(itemTwo, index) in item.hdVideoList"
:key="index"
>
<video :src="itemTwo.filePath"></video>
</div>
</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
......@@ -179,14 +213,26 @@
</van-cell-group>
</div>
<div class="review-wrap" v-if="hdReviewList.length>0">
<div class="review-wrap" v-if="hdReviewList.length > 0">
<p>整改复查</p>
<van-cell-group inset v-for="(item, index) in hdReviewList" :key="index">
<van-cell-group
inset
v-for="(item, index) in hdReviewList"
:key="index"
>
<van-row gutter="">
<van-col span="7"
><span class="field-title">隐患照片:</span></van-col
>
<van-col span="17">{{ item.reviewPicture }}</van-col>
<van-col span="17">
<div
class="detail_pic"
v-for="(itemTwo, index) in item.hdPictureList"
:key="index"
>
<van-image width="100" height="100" :src="itemTwo.filePath" />
</div>
</van-col>
</van-row>
<van-row gutter="">
......@@ -200,15 +246,21 @@
<van-col span="7"
><span class="field-title">复查结果:</span></van-col
>
<van-col span="17">{{ item.reviewResult == 1? "合格":"不合格"}}</van-col>
<van-col span="17">{{
item.reviewResult == 1 ? "合格" : "不合格"
}}</van-col>
</van-row>
</van-cell-group>
</div>
<div class="journal-wrap">
<p>日志信息</p>
<van-cell-group inset >
<van-steps direction="vertical" :active="99999" v-if="hdLogList.length>0">
<van-cell-group inset>
<van-steps
direction="vertical"
:active="99999"
v-if="hdLogList.length > 0"
>
<van-step v-for="(item, index) in hdLogList" :key="index">
<div class="step-wrap">
<van-row>
......@@ -220,47 +272,53 @@
<van-col span="5"
><span class="field-title">审批人:</span></van-col
>
<van-col span="19">{{item.userName}}</van-col>
<van-col span="19">{{ item.userName }}</van-col>
</van-row>
<van-row>
<van-col span="5"
><span class="field-title">节点:</span></van-col
>
<van-col span="19">{{item.logNode}}</van-col>
<van-col span="19">{{ item.logNode }}</van-col>
</van-row>
<van-row>
<van-col span="5"
><span class="field-title">结果:</span></van-col
>
<van-col span="19">{{item.logResult}}</van-col>
<van-col span="19">{{ item.logResult }}</van-col>
</van-row>
<van-row>
<van-col span="5"
><span class="field-title">部门:</span></van-col
>
<van-col span="19">{{item.deptName}}</van-col>
<van-col span="19">{{ item.deptName }}</van-col>
</van-row>
<van-row>
<van-col span="5"
><span class="field-title">时间:</span></van-col
>
<van-col span="19">{{item.createTime}}</van-col>
<van-col span="19">{{ item.createTime }}</van-col>
</van-row>
</div>
</van-step>
</van-steps>
<div style="text-align: center;" v-if="hdLogList.length == 0">暂无数据</div>
<div style="text-align: center;" v-if="hdLogList.length == 0">
暂无数据
</div>
</van-cell-group>
<!-- 展开 -->
<div class="more" @click="journalReverse" v-show="hdLogList.length>0">
<div class="more" @click="journalReverse" v-show="hdLogList.length > 0">
{{ journalOpenText }}
</div>
</div>
<div class="supervise-wrap">
<p>督办信息</p>
<van-cell-group inset >
<van-steps direction="vertical" :active="99999" v-if="instructionsList.length>0">
<van-cell-group inset>
<van-steps
direction="vertical"
:active="99999"
v-if="instructionsList.length > 0"
>
<van-step v-for="(item, index) in instructionsList" :key="index">
<div class="step-wrap">
<van-row>
......@@ -272,34 +330,40 @@
<van-col span="5"
><span class="field-title">审批人:</span></van-col
>
<van-col span="19">{{item.userName}}</van-col>
<van-col span="19">{{ item.userName }}</van-col>
</van-row>
<van-row>
<van-row>
<van-col span="5"
><span class="field-title">时间:</span></van-col
>
<van-col span="19">{{item.createTime}}</van-col>
<van-col span="19">{{ item.createTime }}</van-col>
</van-row>
<van-row>
<van-col span="5"
><span class="field-title">部门:</span></van-col
>
<van-col span="19">{{item.deptName}}</van-col>
<van-col span="19">{{ item.deptName }}</van-col>
</van-row>
<van-row>
<van-row>
<van-col span="5"
><span class="field-title">结果:</span></van-col
>
<van-col span="19">{{item.instructionsContent}}</van-col>
<van-col span="19">{{ item.instructionsContent }}</van-col>
</van-row>
</div>
</van-step>
</van-steps>
<div style="text-align: center;" v-if="instructionsList.length == 0">暂无数据</div>
<div style="text-align: center;" v-if="instructionsList.length == 0">
暂无数据
</div>
</van-cell-group>
<!-- 展开 -->
<div class="more" @click="superviseReverse" v-show="instructionsList.length>0">
<div
class="more"
@click="superviseReverse"
v-show="instructionsList.length > 0"
>
{{ superviseOpenText }}
</div>
</div>
......@@ -327,15 +391,15 @@ export default {
confirmOpen: false,
confirmOpenText: "展开 ▼",
hdReport:"",
hdConfirm:"",
hdMajorApproveList:[], // 重大隐患审批 先不做
hdRectificationList:[],
hdReviewList:[],
hdLogList:[],
beifenhdLogList:[],
instructionsList:[],
beifeninstructionsList:[]
hdReport: "",
hdConfirm: "",
hdMajorApproveList: [], // 重大隐患审批 先不做
hdRectificationList: [],
hdReviewList: [],
hdLogList: [],
beifenhdLogList: [],
instructionsList: [],
beifeninstructionsList: []
};
},
created() {
......@@ -356,14 +420,14 @@ export default {
standBookDetail(`/hdreport/hdDetailsApp/${this.id}`)
.then(res => {
this.$toast.clear();
this.hdReport = res.data.hdReport
this.hdConfirm = res.data.hdConfirm
this.hdRectificationList = res.data.hdRectificationList
this.hdReviewList = res.data.hdReviewList
this.beifenhdLogList = res.data.hdLogList
this.hdLogList = this.beifenhdLogList.slice(-1)
this.beifeninstructionsList = res.data.instructionsList
this.instructionsList = this.beifeninstructionsList.slice(-1)
this.hdReport = res.data.hdReport;
this.hdConfirm = res.data.hdConfirm;
this.hdRectificationList = res.data.hdRectificationList;
this.hdReviewList = res.data.hdReviewList;
this.beifenhdLogList = res.data.hdLogList;
this.hdLogList = this.beifenhdLogList.slice(-1);
this.beifeninstructionsList = res.data.instructionsList;
this.instructionsList = this.beifeninstructionsList.slice(-1);
})
.catch(() => {
this.$toast.clear();
......@@ -396,13 +460,12 @@ export default {
if (this.journalOpen) {
// 显示所有数据
this.journalOpenText = "收起 ▲";
// 显示所有数据
this.hdLogList = this.beifenhdLogList
// 显示所有数据
this.hdLogList = this.beifenhdLogList;
} else {
this.journalOpenText = "展开 ▼";
// 只显示第一个数据
this.hdLogList = this.beifenhdLogList.slice(-1)
// 只显示第一个数据
this.hdLogList = this.beifenhdLogList.slice(-1);
}
},
// 督办信息显示或隐藏
......@@ -411,11 +474,11 @@ export default {
if (this.superviseOpen) {
// 显示所有数据
this.superviseOpenText = "收起 ▲";
this.instructionsList = this.beifeninstructionsList
this.instructionsList = this.beifeninstructionsList;
} else {
// 只渲染一条数据
this.superviseOpenText = "展开 ▼";
this.instructionsList = this.beifeninstructionsList.slice(-1)
this.instructionsList = this.beifeninstructionsList.slice(-1);
}
}
}
......@@ -472,5 +535,19 @@ export default {
font-weight: bolder;
z-index: 99;
}
.detail_pic {
margin-right: 0.266667rem;
float: left;
}
.detail_video {
width: 2.666667rem;
height: 2.666667rem;
margin-right: 0.266667rem;
float: left;
video {
width: 2.666667rem;
height: 2.666667rem;
}
}
}
</style>
......@@ -67,6 +67,16 @@
>
<van-col span="17">{{ riskMain.gradingMethod }}</van-col>
</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-col span="7"
><span class="field-title">技术措施:</span></van-col
......@@ -77,7 +87,11 @@
<van-col span="7"
><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 gutter="">
<van-col span="7"
......@@ -89,7 +103,11 @@
<van-col span="7"
><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 gutter="">
<van-col span="7"
......@@ -101,7 +119,11 @@
<van-col span="7"
><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>
</div>
</van-cell-group>
......
......@@ -154,9 +154,9 @@
autosize
placeholder="请输入"
/>
<van-field name="定级方式" label=" ">
<van-field name="setRankModeFile" label=" ">
<template #input>
<van-uploader v-model="setRankModeImg" />
<van-uploader v-model="setRankModeImg" accept="file"/>
</template>
</van-field>
......@@ -237,9 +237,9 @@
autosize
placeholder="请输入"
/>
<van-field name="技术措施" label=" ">
<van-field name="technologyFile" label=" ">
<template #input>
<van-uploader v-model="technologyImg" />
<van-uploader v-model="technologyImg" accept="file"/>
</template>
</van-field>
......@@ -252,9 +252,9 @@
autosize
placeholder="请输入"
/>
<van-field name="管理措施" label=" ">
<van-field name="administrationFile" label=" ">
<template #input>
<van-uploader v-model="administrationImg" />
<van-uploader v-model="administrationImg" accept="file"/>
</template>
</van-field>
......@@ -267,9 +267,9 @@
autosize
placeholder="请输入"
/>
<van-field name="应急措施" label=" ">
<van-field name="urgentFile" label=" ">
<template #input>
<van-uploader v-model="urgentImg" />
<van-uploader v-model="urgentImg" accept="file"/>
</template>
</van-field>
......@@ -370,6 +370,20 @@ export default {
formdata.append("managementMeasures", this.administration);
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({
message: "提交中...",
......@@ -520,7 +534,7 @@ export default {
myRiskRank(){
console.log(this.setRank);
if(this.setRank == ""){
this.$toast("请先选择风险源");
this.$toast("其他定级方式");
}else if(this.setRank == "其他定级方式"){
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