Commit 713e302e authored by 罗新东's avatar 罗新东

修改了隐患等级全局过滤。

parent 4943ac10
...@@ -20,6 +20,8 @@ import { Divider, Popup, Overlay, Loading, Dialog, ContactCard, Form, AddressEdi ...@@ -20,6 +20,8 @@ import { Divider, Popup, Overlay, Loading, Dialog, ContactCard, Form, AddressEdi
Step, Steps } from 'vant' Step, Steps } from 'vant'
import 'lib-flexible/flexible' import 'lib-flexible/flexible'
import vueEsign from 'vue-esign' import vueEsign from 'vue-esign'
// 全局过滤器
import filters from "@/utils/filters.js"
Vue.use(vueEsign) Vue.use(vueEsign)
Vue.prototype.util = util Vue.prototype.util = util
Vue.use(Divider).use(Popup).use(Overlay).use(Loading).use(Dialog).use(Toast).use(ContactCard).use(Form).use(AddressEdit).use(AddressList).use(Field).use(CellGroup).use(Cell).use(SwipeCell).use(Icon).use(Stepper).use(Card).use(Button).use(Swipe).use(SwipeItem).use(PullRefresh).use(List).use(Tab).use(Tabs).use(GoodsAction).use(GoodsActionIcon).use(GoodsActionButton).use(SubmitBar).use(Checkbox).use(CheckboxGroup).use(Search).use(Picker).use(Uploader).use(Notify) Vue.use(Divider).use(Popup).use(Overlay).use(Loading).use(Dialog).use(Toast).use(ContactCard).use(Form).use(AddressEdit).use(AddressList).use(Field).use(CellGroup).use(Cell).use(SwipeCell).use(Icon).use(Stepper).use(Card).use(Button).use(Swipe).use(SwipeItem).use(PullRefresh).use(List).use(Tab).use(Tabs).use(GoodsAction).use(GoodsActionIcon).use(GoodsActionButton).use(SubmitBar).use(Checkbox).use(CheckboxGroup).use(Search).use(Picker).use(Uploader).use(Notify)
...@@ -43,3 +45,8 @@ Array.prototype.remove = function(val) { ...@@ -43,3 +45,8 @@ Array.prototype.remove = function(val) {
this.splice(index, 1); this.splice(index, 1);
} }
} }
// 注册全局过滤器
Object.keys(filters).forEach(key=>{
Vue.filter(key,filters[key])
})
...@@ -292,6 +292,14 @@ export function myHDList(data){ ...@@ -292,6 +292,14 @@ export function myHDList(data){
}) })
} }
export function deal(url,data){
return request({
url,
method:'post',
data
})
}
......
// 隐患级别
const dangerText = 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{
dangerText
}
\ No newline at end of file
<template> <template>
<div> <div>
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
<van-form <van-form
@submit="onSubmit" @submit="onSubmit"
:scroll-to-error="true" :scroll-to-error="true"
...@@ -18,7 +17,6 @@ ...@@ -18,7 +17,6 @@
type="textarea" type="textarea"
/> />
<van-field <van-field
readonly readonly
clickable clickable
...@@ -123,7 +121,10 @@ ...@@ -123,7 +121,10 @@
:value="findTime" :value="findTime"
label="隐患发现时间" label="隐患发现时间"
placeholder="点击选择日期" placeholder="点击选择日期"
@click="showFindTime = true; currentDate = new Date()" @click="
showFindTime = true;
currentDate = new Date();
"
:rules="[{ required: true, message: '隐患发现时间不能为空' }]" :rules="[{ required: true, message: '隐患发现时间不能为空' }]"
/> />
<van-popup v-model="showFindTime" position="bottom"> <van-popup v-model="showFindTime" position="bottom">
...@@ -210,13 +211,24 @@ ...@@ -210,13 +211,24 @@
<van-field name="hdPicture1" label="隐患照片"> <van-field name="hdPicture1" 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>
<van-field name="hdVideo1" label="隐患视频"> <van-field name="hdVideo1" label="隐患视频">
<template #input> <template #input>
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="uploaderVideo" accept="video/*" /> <van-uploader
multiple
:max-count="5"
upload-text="最多上传五个"
v-model="uploaderVideo"
accept="video/*"
/>
</template> </template>
</van-field> </van-field>
<van-field <van-field
...@@ -226,7 +238,10 @@ ...@@ -226,7 +238,10 @@
:value="expireTime" :value="expireTime"
label="隐患到期时间" label="隐患到期时间"
placeholder="点击选择日期" placeholder="点击选择日期"
@click="showExpireTime = true; currentDate = new Date()" @click="
showExpireTime = true;
currentDate = new Date();
"
/> />
<van-popup v-model="showExpireTime" position="bottom"> <van-popup v-model="showExpireTime" position="bottom">
<van-datetime-picker <van-datetime-picker
...@@ -255,7 +270,6 @@ ...@@ -255,7 +270,6 @@
@cancel="showRecPeople = false" @cancel="showRecPeople = false"
/> />
</van-popup> </van-popup>
<div style="margin: 16px 16px 0"> <div style="margin: 16px 16px 0">
<van-button round block type="info" native-type="submit" <van-button round block type="info" native-type="submit"
>上报</van-button >上报</van-button
...@@ -272,7 +286,7 @@ ...@@ -272,7 +286,7 @@
<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 { timestampToTime } from "@/utils/format"; import { timestampToTime } from "@/utils/format";
import { import {
getFormList, getFormList,
...@@ -289,9 +303,10 @@ export default { ...@@ -289,9 +303,10 @@ export default {
components: { components: {
LHeader, LHeader,
}, },
activated(){ activated() {
this.taskId = this.$route.params.taskId || localStorage.getItem('dangerAddTaskId'); this.taskId =
console.log(this.taskId ); this.$route.params.taskId || localStorage.getItem("dangerAddTaskId");
console.log(this.taskId);
if (this.taskId) { if (this.taskId) {
this.isShowreturnCause = true; this.isShowreturnCause = true;
this.text = "隐患上报退回"; this.text = "隐患上报退回";
...@@ -301,16 +316,17 @@ export default { ...@@ -301,16 +316,17 @@ export default {
}, },
mounted() { mounted() {
this.$bus.$on("sourceAyy", res => { this.$bus.$on("sourceAyy", (res) => {
setTimeout(() => {
this.source1 = res.join(","); this.source1 = res.join(",");
// 销毁一下监听事件 不然会越加越多 // 销毁一下监听事件 不然会越加越多
this.$bus.$off('riskLevelBus') this.$bus.$off("riskLevelBus");
});
}); });
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
if (to.name != "choose-people") { if (to.name != "choose-people") {
this.text = "新增隐患", (this.text = "新增隐患"), (this.projectId = ""); // 所属工程
this.projectId = ""; // 所属工程
this.taskId = ""; this.taskId = "";
this.projectName = ""; this.projectName = "";
this.showProjectName = false; this.showProjectName = false;
...@@ -345,9 +361,9 @@ export default { ...@@ -345,9 +361,9 @@ export default {
this.columnsRecPeople = []; this.columnsRecPeople = [];
this.isShowreturnCause = false; this.isShowreturnCause = false;
this.returnCause = ""; // 退回原因 this.returnCause = ""; // 退回原因
this.currentDate = new Date() this.currentDate = new Date();
// 清空 localStorage // 清空 localStorage
localStorage.removeItem('dangerAddTaskId') localStorage.removeItem("dangerAddTaskId");
} }
next(); next();
}, },
...@@ -390,20 +406,50 @@ export default { ...@@ -390,20 +406,50 @@ export default {
columnsRecPeople: [], columnsRecPeople: [],
isShowreturnCause: false, isShowreturnCause: false,
returnCause: "", // 退回原因 returnCause: "", // 退回原因
currentDate : new Date() currentDate: new Date(),
}; };
}, },
methods: { methods: {
onSubmit(values) { dangerType(danger) {
// 严重隐患 = A
// 较大隐患 = B
// 危险隐患 = C
// 重大隐患 = S
switch (danger) {
case "A":
return "严重隐患";
case "B":
return "较大隐患";
case "C":
return "危险隐患";
case "S":
return "重大隐患";
case "严重隐患":
return "A";
case "较大隐患":
return "B";
case "危险隐患":
return "C";
case "重大隐患":
return "S";
default:
return danger;
}
},
onSubmit(values) {
let formdata = new FormData(); let formdata = new FormData();
formdata.append("proId", this.projectId); formdata.append("proId", this.projectId);
// formdata.append("projectName", this.projectName);
formdata.append("hdRange", values.hdRange); formdata.append("hdRange", values.hdRange);
formdata.append("hdType", values.hdType); formdata.append("hdType", values.hdType);
formdata.append("hdProjectName", values.hdProjectName); formdata.append("hdProjectName", values.hdProjectName);
formdata.append("hdProjectId", values.hdProjectId); formdata.append("hdProjectId", values.hdProjectId);
formdata.append("hdLev", values.hdLev); formdata.append("hdLev", this.dangerType(values.hdLev));
formdata.append("hdDiscoveryTime", values.hdDiscoveryTime); formdata.append("hdDiscoveryTime", values.hdDiscoveryTime);
formdata.append("dangerId", values.dangerId); formdata.append("dangerId", values.dangerId);
formdata.append("dangerSource", values.dangerSource); formdata.append("dangerSource", values.dangerSource);
...@@ -411,20 +457,14 @@ export default { ...@@ -411,20 +457,14 @@ export default {
formdata.append("hdDescribe", values.hdDescribe); formdata.append("hdDescribe", values.hdDescribe);
formdata.append("hdExpirationTime", values.hdExpirationTime); formdata.append("hdExpirationTime", values.hdExpirationTime);
formdata.append("rectificationUser", values.rectificationUser); formdata.append("rectificationUser", values.rectificationUser);
// 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
// return false; // 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
values.hdPicture1.forEach((item) => { values.hdPicture1.forEach((item) => {
formdata.append("hdPicture1[]", item.file); formdata.append("hdPicture1[]", item.file);
}); });
values.hdVideo1.forEach((item) => { values.hdVideo1.forEach((item) => {
formdata.append("hdVideo1[]", item.file); formdata.append("hdVideo1[]", item.file);
}); });
// console.log(formdata)
// for (var [a, b] of formdata.entries()) {
// console.log(a, b);
// }
// return false;
this.$toast.loading({ this.$toast.loading({
message: "提交中...", message: "提交中...",
forbidClick: true, forbidClick: true,
...@@ -483,28 +523,39 @@ export default { ...@@ -483,28 +523,39 @@ export default {
dangerReturnEcho(`/hdreport/edit/${this.taskId}`) dangerReturnEcho(`/hdreport/edit/${this.taskId}`)
.then((res) => { .then((res) => {
this.$toast.clear(); this.$toast.clear();
// 对数据进行赋值 // 对数据进行赋值
this.returnCause = res.data.reason; this.returnCause = res.data.reason;
let msg = res.data.hdReport let msg = res.data.hdReport;
console.log(msg) msg.hdPictureList=msg.hdPictureList||[];
this.projectId=msg.proId msg.hdVideoList=msg.hdVideoList||[];
this.projectName = msg.hdProjectName this.projectId = msg.proId;
this.range = msg.hdRange this.projectName = res.data.projectInformations.filter(
this.type = msg.hdType (item) => item.id == msg.proId
this.dangerName = msg.hdProjectName )[0]["projectName"];
this.dangerNum = msg.hdProjectId this.range = msg.hdRange;
this.dangerLevel = msg.hdLev this.type = msg.hdType;
this.findTime = msg.hdDiscoveryTime this.dangerName = msg.hdProjectName;
this.source = msg.dangerId this.dangerNum = msg.hdProjectId;
this.location = msg.hdPosition this.dangerLevel = this.dangerType(msg.hdLev);
this.describe = msg.hdDescribe this.source1 = this.source1 ? this.source1 : msg.dangerSource;
this.expireTime = msg.hdExpirationTime this.findTime = msg.hdDiscoveryTime;
this.recPeople = msg.rectificationUser this.source = msg.dangerId;
this.uploaderImg = msg.hdPictureList||[] this.location = msg.hdPosition;
this.uploaderVideo = msg.hdVideoList||[] this.describe = msg.hdDescribe;
this.expireTime = msg.hdExpirationTime;
this.recPeople = msg.rectificationUser;
this.uploaderImg = msg.hdPictureList.map(item=>{
return {
...item,
url:item.filePath
}
})
this.uploaderVideo = msg.hdVideoList.map(item=>{
return {
...item,
url:item.filePath
}
})
}) })
.catch(() => { .catch(() => {
this.$toast.clear(); this.$toast.clear();
...@@ -514,9 +565,9 @@ export default { ...@@ -514,9 +565,9 @@ export default {
// 所属项目 // 所属项目
onConProjectName(value) { onConProjectName(value) {
if(!value){ if (!value) {
this.showProjectName = false; this.showProjectName = false;
return return;
} }
this.projectId = value.id; this.projectId = value.id;
this.projectName = value.projectName; this.projectName = value.projectName;
...@@ -528,9 +579,9 @@ export default { ...@@ -528,9 +579,9 @@ export default {
}, },
// 适用范围 // 适用范围
onConRange(value) { onConRange(value) {
if(!value){ if (!value) {
this.showRange = false; this.showRange = false;
return return;
} }
this.range = value.hdRange; this.range = value.hdRange;
this.showRange = false; this.showRange = false;
...@@ -545,9 +596,9 @@ export default { ...@@ -545,9 +596,9 @@ export default {
}, },
// 隐患类型 // 隐患类型
onConType(value) { onConType(value) {
if(!value){ if (!value) {
this.showType = false; this.showType = false;
return return;
} }
this.type = value.hdType; this.type = value.hdType;
this.showType = false; this.showType = false;
...@@ -563,9 +614,9 @@ export default { ...@@ -563,9 +614,9 @@ export default {
}, },
// 隐患项目名称 // 隐患项目名称
onConDangerName(value) { onConDangerName(value) {
if(!value){ if (!value) {
this.showDangerName = false; this.showDangerName = false;
return return;
} }
this.dangerName = value.hdName; this.dangerName = value.hdName;
this.showDangerName = false; this.showDangerName = false;
...@@ -574,7 +625,7 @@ export default { ...@@ -574,7 +625,7 @@ export default {
`/hdreport/showHdInventories/${this.range}/${this.type}/${this.dangerName}` `/hdreport/showHdInventories/${this.range}/${this.type}/${this.dangerName}`
).then((res) => { ).then((res) => {
this.dangerNum = res.data[0].hdId; this.dangerNum = res.data[0].hdId;
this.dangerLevel = res.data[0].hdLev; this.dangerLevel = this.dangerType(res.data[0].hdLev);
}); });
}, },
// 隐患发现时间 // 隐患发现时间
...@@ -585,9 +636,9 @@ export default { ...@@ -585,9 +636,9 @@ export default {
}, },
// 风险源 // 风险源
onConSource(value) { onConSource(value) {
if(!value){ if (!value) {
this.showSource = false; this.showSource = false;
return return;
} }
this.source = value.factor; this.source = value.factor;
this.showSource = false; this.showSource = false;
...@@ -599,10 +650,10 @@ export default { ...@@ -599,10 +650,10 @@ export default {
}); });
}, },
// 风险源第二个字段 // 风险源第二个字段
onConSource1(value) { // onConSource1(value) {
this.source1 = value.riskSource; // this.source1 = value.riskSource;
this.showSource1 = false; // this.showSource1 = false;
}, // },
goSelectTwo() { goSelectTwo() {
if (this.source) { if (this.source) {
// 跳转到多选页面 // 跳转到多选页面
...@@ -624,9 +675,9 @@ export default { ...@@ -624,9 +675,9 @@ export default {
}, },
// 隐患整改人 // 隐患整改人
onConRecPeople(value) { onConRecPeople(value) {
if(!value){ if (!value) {
this.showRecPeople = false; this.showRecPeople = false;
return return;
} }
this.recPeople = value.userName; this.recPeople = value.userName;
this.showRecPeople = false; this.showRecPeople = false;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</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 }}</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>
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</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 }}</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>
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
</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 }}</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>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</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 }}</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>
...@@ -234,10 +234,10 @@ export default { ...@@ -234,10 +234,10 @@ export default {
} }
let formdata = new FormData(); let formdata = new FormData();
formdata.append("confirmResult", this.radio); formdata.append("confirmResult", this.radio);
formdata.append("endTime", values.endTime); formdata.append("endTime", values.endTime?values.endTime:'');
formdata.append("rectificationUser", values.rectificationUser); formdata.append("rectificationUser", values.rectificationUser?values.rectificationUser:'');
formdata.append("rectificationReview", values.rectificationReview); formdata.append("rectificationReview", values.rectificationReview?values.rectificationReview:'');
formdata.append("confirmOpinion", values.confirmOpinion); formdata.append("confirmOpinion", values.confirmOpinion?values.confirmOpinion:'');
this.$toast.loading({ this.$toast.loading({
message: "提交中...", message: "提交中...",
forbidClick: true, forbidClick: true,
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</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 }}</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>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</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 }}</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>
...@@ -135,9 +135,11 @@ export default { ...@@ -135,9 +135,11 @@ export default {
// 详情 // 详情
goDetail(data) { goDetail(data) {
this.$router.push({ this.$router.push({
name: "risk-big-detail", name: "normal-detail",
params: { params: {
id: data.businessId, id: data.businessId,
api:'/delayApply/deal/',
method:'get'
}, },
}); });
this.showIndex = null; this.showIndex = null;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</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 }}</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>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</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 }}</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>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="7">隐患级别:</van-col> <van-col span="7">隐患级别:</van-col>
<van-col span="17">{{ item.hdLev }}</van-col> <van-col span="17">{{ item.hdLev | dangerText }}</van-col>
</van-row> </van-row>
<!-- <van-row gutter=""> <!-- <van-row gutter="">
<van-col span="7">发现时间:</van-col> <van-col span="7">发现时间:</van-col>
...@@ -67,8 +67,8 @@ ...@@ -67,8 +67,8 @@
clickable clickable
name="thinkHdLev" name="thinkHdLev"
:value="thinkLevel" :value="thinkLevel"
label="认定隐患级别" label="认定隐患级别"
placeholder="重大隐患" placeholder="请选择认定隐患级别"
@click="showThinkLevel = true" @click="showThinkLevel = true"
:rules="[{ required: true, message: '认定隐患级别不能为空' }]" :rules="[{ required: true, message: '认定隐患级别不能为空' }]"
/> />
...@@ -125,8 +125,8 @@ export default { ...@@ -125,8 +125,8 @@ export default {
text: "重大隐患审批", text: "重大隐患审批",
agreeOpinion: "", agreeOpinion: "",
disagreeOpinion: "", disagreeOpinion: "",
thinkLevel:'建议为严重隐患', //因为隐患级别 thinkLevel:'', //因为隐患级别
thinkHdLev:'建议为严重隐患', thinkHdLev:'',
showThinkLevel: false, showThinkLevel: false,
columnsThinkLevel:["建议为严重隐患","建议为较大隐患","建议为危险隐患",] columnsThinkLevel:["建议为严重隐患","建议为较大隐患","建议为危险隐患",]
...@@ -162,7 +162,7 @@ export default { ...@@ -162,7 +162,7 @@ export default {
let formdata = new FormData() let formdata = new FormData()
formdata.append('isResult', values.isResult) formdata.append('isResult', values.isResult)
formdata.append('details', values.details) formdata.append('details', values.details)
formdata.append('thinkHdLev',values.isResult==1?'建议为严重隐患':values.thinkHdLev) formdata.append('thinkHdLev',values.isResult==1?'':values.thinkHdLev)
formdata.append('taskId', this.taskId) formdata.append('taskId', this.taskId)
majorAdd(`/majorapprove/add`,formdata) majorAdd(`/majorapprove/add`,formdata)
.then(res => { .then(res => {
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</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 }}</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>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="7">隐患级别:</van-col> <van-col span="7">隐患级别:</van-col>
<van-col span="17">{{ item.hdLev }}</van-col> <van-col span="17">{{ item.hdLev | dangerText }}</van-col>
</van-row> </van-row>
<!-- <van-row gutter=""> <!-- <van-row gutter="">
<van-col span="7">隐患发现时间:</van-col> <van-col span="7">隐患发现时间:</van-col>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</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 }}</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>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</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 }}</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>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</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 }}</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>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</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 }}</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>
......
...@@ -134,19 +134,19 @@ ...@@ -134,19 +134,19 @@
><div class="info-title">隐患认定</div></van-col ><div class="info-title">隐患认定</div></van-col
> >
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="" v-if="item.rectificationUser">
<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">{{ item.rectificationUser }}</van-col> <van-col span="17">{{ item.rectificationUser}}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="" v-if="item.rectificationReview">
<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">{{ item.rectificationReview }}</van-col> <van-col span="17">{{ item.rectificationReview }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="" v-if="item.endTime">
<van-col span="8" <van-col span="8"
><span class="field-title">整改截止时间:</span></van-col ><span class="field-title">整改截止时间:</span></van-col
> >
...@@ -450,7 +450,7 @@ ...@@ -450,7 +450,7 @@
<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 { standBookDetail } from "@/service/danger"; import { standBookDetail,deal } from "@/service/danger";
export default { export default {
components: { components: {
LHeader, LHeader,
...@@ -500,7 +500,7 @@ export default { ...@@ -500,7 +500,7 @@ export default {
loadingType: "spinner", loadingType: "spinner",
duration: 0, duration: 0,
}); });
standBookDetail(`/hdreport/hdDetailsApp/${this.id}`) (this.$route.params.method=='get'?getFun:postFun)(`${this.$route.params.api?this.$route.params.api:'/hdreport/hdDetailsApp/'}${this.id}`)
.then((res) => { .then((res) => {
this.$toast.clear(); this.$toast.clear();
this.hdReport = res.data.hdReport; this.hdReport = res.data.hdReport;
...@@ -515,7 +515,8 @@ export default { ...@@ -515,7 +515,8 @@ export default {
this.beifeninstructionsList = res.data.instructionsList; this.beifeninstructionsList = res.data.instructionsList;
this.instructionsList = this.beifeninstructionsList.slice(-1); this.instructionsList = this.beifeninstructionsList.slice(-1);
}) })
.catch(() => { .catch((err) => {
console.log(err)
this.$toast.clear(); this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试"); this.$toast.fail("加载失败,请稍后再试");
}); });
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</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 }}</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>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="7">隐患级别:</van-col> <van-col span="7">隐患级别:</van-col>
<van-col span="17">{{ item.hdLev }}</van-col> <van-col span="17">{{ item.hdLev | dangerText }}</van-col>
</van-row> </van-row>
<!-- <van-row gutter=""> <!-- <van-row gutter="">
<van-col span="7">隐患发现时间:</van-col> <van-col span="7">隐患发现时间:</van-col>
......
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
<!-- 搜索 --> <!-- 搜索 -->
<div class="search-wrap"> <div class="search-wrap">
<!-- <van-search <van-search
v-model="searchVal" v-model="searchVal"
show-action show-action
placeholder="请输入检查名称" placeholder="请输入消息内容"
@search="onSearch" @search="onSearch"
> >
<template #action> <template #action>
<div @click="onSearch">搜索</div> <div @click="onSearch">搜索</div>
</template> </template>
</van-search> --> </van-search>
<!-- <van-search v-model="searchVal" placeholder="搜索" @search="onSearch" /> --> <!-- <van-search v-model="searchVal" placeholder="搜索" @search="onSearch" /> -->
</div> </div>
<!-- 内容列表 --> <!-- 内容列表 -->
...@@ -42,9 +42,10 @@ ...@@ -42,9 +42,10 @@
:key="index" :key="index"
@click="touchstart(index, item)" @click="touchstart(index, item)"
> >
<!--@touchend.prevent="touchend(index)" 长按备份--> <!--@touchend.prevent="touchend(index)" 长按备份-->
<div class="messgae-title"><span>{{ item.noticeTitle }}</span> <span>{{item.sendTime}}</span> </div> <div class="messgae-title">
<span>{{ item.noticeTitle }}</span> <span>{{ item.sendTime }}</span>
</div>
<div class="message-content"> <div class="message-content">
{{ item.upcomingUserName }},您好!您有一条来自{{ {{ item.upcomingUserName }},您好!您有一条来自{{
item.createUserName item.createUserName
...@@ -54,7 +55,7 @@ ...@@ -54,7 +55,7 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index" v-if="item.status == '未读'"> <van-overlay :show="showIndex == index" v-if="item.status == '未读'">
<div class="wrapper" @click.stop ="showIndex = null"> <div class="wrapper" @click.stop="showIndex = null">
<!-- <van-button round type="primary" @click="goDetail(item)" <!-- <van-button round type="primary" @click="goDetail(item)"
>查看</van-button >查看</van-button
> --> > -->
...@@ -84,16 +85,16 @@ export default { ...@@ -84,16 +85,16 @@ export default {
messageCategory: [ messageCategory: [
{ {
key: "0", key: "0",
category: "未读" category: "未读",
}, },
{ {
key: "1", key: "1",
category: "已读" category: "已读",
}, },
{ {
key: "2", key: "2",
category: "全部" category: "全部",
} },
], ],
activeIndex: 0, activeIndex: 0,
activeVal: "未读", activeVal: "未读",
...@@ -104,7 +105,7 @@ export default { ...@@ -104,7 +105,7 @@ export default {
// finished: false // 列表数据全部加载完成 // finished: false // 列表数据全部加载完成
Loop: "", // 定时器 Loop: "", // 定时器
showIndex: null // 是否显示遮罩层 showIndex: null, // 是否显示遮罩层
}; };
}, },
created() { created() {
...@@ -123,21 +124,25 @@ export default { ...@@ -123,21 +124,25 @@ export default {
// 搜索事件 // 搜索事件
onSearch(val) { onSearch(val) {
// console.log(this.searchVal); this.selectCategory(this.activeVal, this.searchVal);
// if(this.showIndex==2){
// }else{
// }
}, },
// 封装全部 已读 和 未读的方法 // 封装全部 已读 和 未读的方法
selectCategory(data) { selectCategory(data, val = "") {
if (data == "全部") { if (data == "全部") {
if (val) {
let formData = new FormData();
formData.append("noticeContent", val);
this.getMessageList(formData);
} else {
this.getMessageList(); this.getMessageList();
}
} else { } else {
let formData = new FormData(); let formData = new FormData();
formData.append("status", data); formData.append("status", data);
if (val) {
formData.append("noticeContent", val);
}
this.getMessageList(formData); this.getMessageList(formData);
} }
}, },
...@@ -149,7 +154,7 @@ export default { ...@@ -149,7 +154,7 @@ export default {
if (data.status == "未读") { if (data.status == "未读") {
let formData = new FormData(); let formData = new FormData();
formData.append("ids", data.pid); formData.append("ids", data.pid);
noticeRemove("/mobile/noticeRemove", formData).then(res => { noticeRemove("/mobile/noticeRemove", formData).then((res) => {
if (res.code == 0) { if (res.code == 0) {
// 如果请求接口成功 则重新请求一下未读消息的条数 // 如果请求接口成功 则重新请求一下未读消息的条数
this.unRead(); this.unRead();
...@@ -165,7 +170,7 @@ export default { ...@@ -165,7 +170,7 @@ export default {
unRead() { unRead() {
let formData = new FormData(); let formData = new FormData();
formData.append("status", "未读"); formData.append("status", "未读");
postMessgaelist("/mobile/notice", formData).then(res => { postMessgaelist("/mobile/notice", formData).then((res) => {
if (res.code == 0) { if (res.code == 0) {
// 向父组件发送消息条数 // 向父组件发送消息条数
this.$emit("messageLength", res.total); this.$emit("messageLength", res.total);
...@@ -177,7 +182,7 @@ export default { ...@@ -177,7 +182,7 @@ export default {
// 请求消息接口方法 // 请求消息接口方法
getMessageList(data) { getMessageList(data) {
postMessgaelist("/mobile/notice", data).then(res => { postMessgaelist("/mobile/notice", data).then((res) => {
this.messageList = res.rows; this.messageList = res.rows;
}); });
}, },
...@@ -235,8 +240,7 @@ export default { ...@@ -235,8 +240,7 @@ export default {
goDetail(data) { goDetail(data) {
this.showIndex = null; this.showIndex = null;
}, },
},
}
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
...@@ -276,14 +280,14 @@ export default { ...@@ -276,14 +280,14 @@ export default {
} }
// 内容 // 内容
.con-list { .con-list {
margin-top: .266667rem; margin-top: 0.266667rem;
.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;
.messgae-title{ .messgae-title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<!-- 搜索 --> <!-- 搜索 -->
<div class="search-wrap"> <div class="search-wrap">
<van-search <!-- <van-search
v-model="searchVal" v-model="searchVal"
show-action show-action
placeholder="请输入检查名称" placeholder="请输入检查名称"
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<template #action> <template #action>
<div @click="onSearch">搜索</div> <div @click="onSearch">搜索</div>
</template> </template>
</van-search> </van-search> -->
<!-- <van-search <!-- <van-search
v-model="searchVal" v-model="searchVal"
placeholder="搜索" placeholder="搜索"
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<!-- 搜索 --> <!-- 搜索 -->
<div class="search-wrap"> <div class="search-wrap">
<!-- <van-search <van-search
v-model="searchVal" v-model="searchVal"
show-action show-action
placeholder="请输入检查名称" placeholder="请输入检查名称"
...@@ -27,8 +27,7 @@ ...@@ -27,8 +27,7 @@
<template #action> <template #action>
<div @click="onSearch">搜索</div> <div @click="onSearch">搜索</div>
</template> </template>
</van-search> --> </van-search>
<!-- <van-search v-model="searchVal" placeholder="搜索" @search="onSearch" /> -->
</div> </div>
<!-- 内容列表 --> <!-- 内容列表 -->
......
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