Commit 53b64c7b authored by 罗新东's avatar 罗新东

理由或者意见

parent 70801aac
Pipeline #7191 passed with stage
in 10 seconds
...@@ -20,6 +20,28 @@ const dangerText = function(danger) { ...@@ -20,6 +20,28 @@ const dangerText = function(danger) {
return danger return danger
} }
} }
const riskText = function(danger) {
// 严重隐患 = A
// 较大隐患 = B
// 危险隐患 = C
// 重大隐患 = S
switch(danger){
case 'A':
return '严重风险'
case 'B':
return '较大风险'
case 'C':
return '危险风险'
case 'S':
return '重大风险'
default:
return danger
}
}
export default{ export default{
dangerText dangerText,
riskText
} }
\ No newline at end of file
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
:key="index" :key="index"
@click="goDetail(item.taskId)" @click="goDetail(item.taskId)"
> >
<van-row gutter="">
<van-col span="6">隐患编号:</van-col>
<van-col span="18">{{ item.businessId }}</van-col>
</van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="6">所属项目:</van-col> <van-col span="6">所属项目:</van-col>
<van-col span="18">{{ item.proId }}</van-col> <van-col span="18">{{ item.proId }}</van-col>
...@@ -57,6 +61,7 @@ ...@@ -57,6 +61,7 @@
<!-- 同意时的选项 --> <!-- 同意时的选项 -->
<div class="agree" v-if="radio == 1"> <div class="agree" v-if="radio == 1">
<van-field <van-field
required
readonly readonly
clickable clickable
name="endTime" name="endTime"
...@@ -80,6 +85,7 @@ ...@@ -80,6 +85,7 @@
<van-field <van-field
readonly readonly
required
clickable clickable
name="rectificationUser" name="rectificationUser"
:value="valueRect" :value="valueRect"
...@@ -100,6 +106,7 @@ ...@@ -100,6 +106,7 @@
<van-field <van-field
readonly readonly
required
clickable clickable
name="rectificationReview" name="rectificationReview"
:value="valueReview" :value="valueReview"
...@@ -119,6 +126,7 @@ ...@@ -119,6 +126,7 @@
</van-popup> </van-popup>
<van-field <van-field
required
v-model="valueIdea" v-model="valueIdea"
label="意见" label="意见"
name="confirmOpinion" name="confirmOpinion"
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
rows="3" rows="3"
type="textarea" type="textarea"
placeholder="请输入" placeholder="请输入"
required
:rules="[{ required: true, message: '理由或者意见不能为空' }]" :rules="[{ required: true, message: '理由或者意见不能为空' }]"
/> />
......
...@@ -2,46 +2,46 @@ ...@@ -2,46 +2,46 @@
<div> <div>
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
<van-cell-group <van-cell-group
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@click="goDetail(item.taskId)" @click="goDetail(item.taskId)"
> >
<van-row gutter=""> <van-row gutter="">
<van-col span="6">所属项目:</van-col> <van-col span="6">所属项目:</van-col>
<van-col span="18">{{ item.proId }}</van-col> <van-col span="18">{{ item.proId }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="6">隐患级别:</van-col> <van-col span="6">隐患级别:</van-col>
<van-col span="18">{{ item.hdLev | dangerText }}</van-col> <van-col span="18">{{ item.hdLev | dangerText }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="6">适用范围:</van-col> <van-col span="6">适用范围:</van-col>
<van-col span="18">{{ item.hdRange }}</van-col> <van-col span="18">{{ item.hdRange }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="6">隐患类型:</van-col> <van-col span="6">隐患类型:</van-col>
<van-col span="18">{{ item.hdType }}</van-col> <van-col span="18">{{ item.hdType }}</van-col>
</van-row> </van-row>
<!-- <van-row gutter=""> <!-- <van-row gutter="">
<van-col span="6">发现时间:</van-col> <van-col span="6">发现时间:</van-col>
<van-col span="18">{{ item.hdDiscoveryTime }}</van-col> <van-col span="18">{{ item.hdDiscoveryTime }}</van-col>
</van-row> --> </van-row> -->
<van-row gutter=""> <van-row gutter="">
<van-col span="6">超期标识:</van-col> <van-col span="6">超期标识:</van-col>
<van-col span="18">{{ item | formatTime }}</van-col> <van-col span="18">{{ item | formatTime }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="6">状态:</van-col> <van-col span="6">状态:</van-col>
<van-col span="18">{{ item.taskName }}</van-col> <van-col span="18">{{ item.taskName }}</van-col>
</van-row> </van-row>
<!-- 详情 --> <!-- 详情 -->
<div class="detail">详情</div> <div class="detail">详情</div>
</van-cell-group> </van-cell-group>
<van-form <van-form
@submit="onSubmit" @submit="onSubmit"
:show-error='false' :show-error="false"
:scroll-to-error="true" :scroll-to-error="true"
validate-trigger="onSubmit" validate-trigger="onSubmit"
> >
...@@ -67,14 +67,17 @@ ...@@ -67,14 +67,17 @@
rows="3" rows="3"
type="textarea" type="textarea"
placeholder="请输入" placeholder="请输入"
required
:rules="[{ required: true, message: '详情描述不能为空' }]" :rules="[{ required: true, message: '详情描述不能为空' }]"
/> />
<van-field <van-field name="uploader" label="复查照片">
name="uploader"
label="复查照片"
>
<template #input> <template #input>
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="uploaderImg" /> <van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="uploaderImg"
/>
</template> </template>
</van-field> </van-field>
</div> </div>
...@@ -88,17 +91,18 @@ ...@@ -88,17 +91,18 @@
rows="3" rows="3"
type="textarea" type="textarea"
placeholder="请输入" placeholder="请输入"
required
:rules="[{ required: true, message: '退回原因不能为空' }]" :rules="[{ required: true, message: '退回原因不能为空' }]"
/> />
</div> </div>
<div style="margin: 16px;"> <div style="margin: 16px">
<van-button round block type="info" native-type="submit" <van-button round block type="info" native-type="submit"
>保存</van-button >保存</van-button
> >
</div> </div>
</van-form> </van-form>
<div style="margin:10px 16px 0px;padding-bottom:16px"> <div style="margin: 10px 16px 0px; padding-bottom: 16px">
<van-button round block type="warning" @click.native="cancel" <van-button round block type="warning" @click.native="cancel"
>取消</van-button >取消</van-button
> >
...@@ -108,11 +112,11 @@ ...@@ -108,11 +112,11 @@
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import {getFun,postFun} from "@/service/table.js"; import { getFun, postFun } from "@/service/table.js";
import { dangerReviewAdd } from "@/service/danger"; import { dangerReviewAdd } from "@/service/danger";
export default { export default {
components: { components: {
LHeader LHeader,
}, },
data() { data() {
return { return {
...@@ -122,28 +126,30 @@ export default { ...@@ -122,28 +126,30 @@ export default {
text: "隐患复查", text: "隐患复查",
detail: "", detail: "",
uploaderImg: [], uploaderImg: [],
returnReason: "" returnReason: "",
}; };
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
console.log('执行了此钩子') console.log("执行了此钩子");
next(vm => { next((vm) => {
if (from.name === "review-danger"||from.name=="normal-detail") { if (from.name === "review-danger" || from.name == "normal-detail") {
vm.messageList = []; vm.messageList = [];
// 修改bug回退获取不到参数有参数的用参数没参数的话用本地缓存 // 修改bug回退获取不到参数有参数的用参数没参数的话用本地缓存
let paramsData = to.params.data||JSON.parse(localStorage.getItem('reviewdanger_params')); let paramsData =
to.params.data ||
JSON.parse(localStorage.getItem("reviewdanger_params"));
vm.taskId = paramsData.taskId; vm.taskId = paramsData.taskId;
vm.messageList.push(paramsData); vm.messageList.push(paramsData);
vm.radio= "1"; vm.radio = "1";
vm.detail = ""; vm.detail = "";
vm.uploaderImg = []; // 隐患整改人 vm.uploaderImg = []; // 隐患整改人
vm.returnReason = ""; vm.returnReason = "";
} }
}); });
}, },
created() { created() {
console.log('执行了此钩子1') console.log("执行了此钩子1");
}, },
methods: { methods: {
selectResult(val) { selectResult(val) {
this.radio = val; this.radio = val;
...@@ -154,24 +160,24 @@ export default { ...@@ -154,24 +160,24 @@ export default {
message: "提交中...", message: "提交中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0 duration: 0,
}); });
let formdata = new FormData() let formdata = new FormData();
formdata.append('reviewResult', this.radio) formdata.append("reviewResult", this.radio);
formdata.append('reviewDetails', values.reviewDetails) formdata.append("reviewDetails", values.reviewDetails);
// 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式 // 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
if (values.uploader) { if (values.uploader) {
values.uploader.forEach(item => { values.uploader.forEach((item) => {
formdata.append("reviewPicture1[]", item.file); 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.$toast.success({ this.$toast.success({
message: "提交成功", message: "提交成功",
duration: 2000 duration: 2000,
}); });
history.go(-1); history.go(-1);
}) })
...@@ -185,16 +191,16 @@ export default { ...@@ -185,16 +191,16 @@ export default {
this.$router.push({ this.$router.push({
name: "normal-detail", name: "normal-detail",
params: { params: {
id: taskId id: taskId,
} },
}); });
}, },
cancel() { cancel() {
this.$router.go(-1); this.$router.go(-1);
} },
}, },
filters: { filters: {
formatTime: function(row) { formatTime: function (row) {
if (new Date(row.dueDate).getTime() <= row.rectificationTime) { if (new Date(row.dueDate).getTime() <= row.rectificationTime) {
return "超期"; return "超期";
} else if ( } else if (
...@@ -206,33 +212,33 @@ export default { ...@@ -206,33 +212,33 @@ export default {
} else { } else {
return "正常"; return "正常";
} }
} },
} },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/* @import url(); 引入css类 */ /* @import url(); 引入css类 */
.van-cell-group--inset { .van-cell-group--inset {
margin: 0; margin: 0;
margin-bottom: 10px; margin-bottom: 10px;
padding: 10px; padding: 10px;
font-size: 13px; font-size: 13px;
position: relative; position: relative;
.van-row { .van-row {
margin-bottom: 0.133333rem; margin-bottom: 0.133333rem;
line-height: 0.64rem; line-height: 0.64rem;
} }
.van-overlay { .van-overlay {
position: absolute; position: absolute;
.wrapper { .wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-evenly; justify-content: space-evenly;
height: 100%; height: 100%;
}
} }
} }
.detail { }
.detail {
position: absolute; position: absolute;
bottom: 0.32rem; bottom: 0.32rem;
right: 15px; right: 15px;
......
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