Commit 1ef2a6d0 authored by 胡占生's avatar 胡占生 🇨🇳

fix: 创建任务,任务管理,接口联调对接修复

parent f1c1237c
<template> <template>
<div> <div>
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
<van-tabs v-model="active" color="#2980f7"
animated
>
<van-tab title="固有风险信息">
<van-form <van-form
@submit="onSubmit" @submit="onSubmit"
:scroll-to-error="true" :scroll-to-error="true"
...@@ -364,6 +368,69 @@ ...@@ -364,6 +368,69 @@
>取消</van-button >取消</van-button
> >
</div> </div>
</van-tab>
<van-tab title="现状风险">
<div
class="con-list"
@touchmove="showIndex = null"
>
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
>
<div style="font-size: 0.45rem;padding: 5px 0;">{{item.title}}</div>
<van-row gutter="">
<van-col span="17">
<van-row gutter="">
<van-col span="9">风险系数:</van-col>
<van-col span="15">{{ item.time}}</van-col>
</van-row>
<van-row gutter="">
<van-col span="9">创建时间:</van-col>
<van-col span="15">{{ item.name }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="9">风险描述:</van-col>
<van-col span="15">{{ item.name }}</van-col>
</van-row>
</van-col>
<van-col span="7" :style="{'color':item.state == 1 ? '#0069e5':'#03b615'}">
{{ '●待审批'}}
</van-col>
</van-row>
</van-cell-group>
<div
style="
width: 100%;
text-align: center;
font-size: 0.48rem;
position: fixed;
top: 30%;
"
v-if="messageList['length']==0"
>
暂无数据
</div>
</div>
</van-tab>
</van-tabs>
<div style="display: flex;
justify-content: space-around;
background-color: #fff;
border-top: 1px solid #e3e3e3;
height: 1.5rem;
width: 100%;
text-align: center;
position: fixed;
bottom: 0;">
<div @click="performTasks" style="color: #4bced0;font-size: 14px;font-weight: 600;">
<div style="font-size: 22px;"><van-icon name="plus" /></div>
<div>新增现状风险</div>
</div>
</div>
</div> </div>
</template> </template>
...@@ -419,6 +486,7 @@ export default { ...@@ -419,6 +486,7 @@ export default {
text: "添加固有风险", text: "添加固有风险",
id: "", id: "",
isTimely:1, isTimely:1,
active:0,
form:{ form:{
}, },
...@@ -432,6 +500,14 @@ export default { ...@@ -432,6 +500,14 @@ export default {
factor: "", //风险因素 factor: "", //风险因素
showFactor: false, showFactor: false,
columnsFactor: [], columnsFactor: [],
messageList: [
{
title:'回显风险源名称',
time:'2022-12-12',
name:'Mr.周',
state:1
}
],
source: "", //风险源 source: "", //风险源
showSource: false, showSource: false,
columnsSource: [], columnsSource: [],
...@@ -480,6 +556,9 @@ export default { ...@@ -480,6 +556,9 @@ export default {
// this.getList(); // this.getList();
}, },
methods: { methods: {
performTasks(){
console.log('1233213 :>> ', 1233213);
},
// 点击预览图 // 点击预览图
clickPre(e) { clickPre(e) {
console.log(e); console.log(e);
...@@ -703,6 +782,36 @@ export default { ...@@ -703,6 +782,36 @@ export default {
}, },
}; };
</script> </script>
<style scoped> <style lang="less" scoped>
/* @import url(); 引入css类 */ /* @import url(); 引入css类 */
.con-list {
margin-bottom: 1.5rem;
padding: 0;
background-color: #f0f1f5;
.van-cell-group--inset {
margin: 0;
margin-bottom: 0.26667rem;
padding: 0.25rem;
font-size: 0.4rem;
position: relative;
border-radius: 4%;
box-shadow: 0px 0px 10px 2px #f3f3f3;
width: 90%;
margin: 0.4rem auto;
.van-row {
font-size: 0.4rem;
line-height: 0.8rem;
margin-bottom: 0;
}
.van-overlay {
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
}
}
}
}
</style> </style>
...@@ -7,12 +7,15 @@ ...@@ -7,12 +7,15 @@
:show-error="false" :show-error="false"
validate-trigger="onSubmit" validate-trigger="onSubmit"
> >
<van-divider style="background-color: #fff; margin: 0;padding: 0.2rem 0;" content-position="left">服务项目信息</van-divider> <div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" >
<img src="@/assets/accidentIcon/bookmark.svg" alt="" style="position: relative;top: 32%;transform: translateY(-50%);" >
服务项目信息
</div>
<van-field <van-field
readonly readonly
required required
name="creatBy" name="userName"
:value="form.creatBy" :value="form.userName"
label="创建人员" label="创建人员"
placeholder="请输入" placeholder="请输入"
:rules="[{ required: true, message: '创建人员不能为空' }]" :rules="[{ required: true, message: '创建人员不能为空' }]"
...@@ -20,27 +23,26 @@ ...@@ -20,27 +23,26 @@
<van-field <van-field
readonly readonly
required required
name="creatUnit" name="deptName"
:value="form.creatUnit" :value="form.deptName"
label="创建单位" label="创建单位"
placeholder="请输入" placeholder="请输入"
:rules="[{ required: true, message: '创建单位不能为空' }]" :rules="[{ required: true, message: '创建单位不能为空' }]"
/> />
<van-field <van-field
required required
name="taskName" name="name"
:value="form.taskName" v-model="form.name"
label="任务名称" label="任务名称"
placeholder="请输入" placeholder="请输入"
:rules="[{ required: true, message: '任务名称不能为空' }]" :rules="[{ required: true, message: '任务名称不能为空' }]"
/> />
<van-field <van-field
readonly
required required
clickable clickable
name="source" name="projectName"
:value="form.source" :value="form.projectName"
label="关联项目" label="关联项目"
placeholder="请选择" placeholder="请选择"
@click="showSource = true" @click="showSource = true"
...@@ -49,7 +51,7 @@ ...@@ -49,7 +51,7 @@
<van-popup v-model="showSource" position="bottom"> <van-popup v-model="showSource" position="bottom">
<van-picker <van-picker
show-toolbar show-toolbar
value-key="sourceName" value-key="name"
:columns="columnsSource" :columns="columnsSource"
@confirm="onConSource" @confirm="onConSource"
@cancel="showSource = false" @cancel="showSource = false"
...@@ -57,86 +59,123 @@ ...@@ -57,86 +59,123 @@
</van-popup> </van-popup>
<van-field <van-field
readonly
required required
name="taskName" name="buildingNames"
:value="form.taskName" :value="form.buildingNames"
label="评估楼栋" label="评估楼栋"
placeholder="请输入" placeholder="请输入"
@click="getRiskList()"
:rules="[{ required: true, message: '评估楼栋不能为空' }]" :rules="[{ required: true, message: '评估楼栋不能为空' }]"
/> />
<div style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" >
<img src="@/assets/accidentIcon/bookmark.svg" alt="" style="position: relative;top: 32%;transform: translateY(-50%);" >
任务组织与分配
</div>
<van-field <van-field
readonly
required required
clickable clickable
name="trouble" name="leaderUserName"
:value="form.trouble" :value="form.leaderUserName"
label="项目负责人" label="项目负责人"
placeholder="请选择" placeholder="请选择"
@click="showTrouble = true" @click="getLeaderUserList('leaderUser')"
:rules="[{ required: true, message: '事故类型不能为空' }]" :rules="[{ required: true, message: '项目负责人不能为空' }]"
/> />
<van-popup v-model="showTrouble" position="bottom">
<van-picker
show-toolbar
value-key="accidentType"
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</van-popup>
<van-field <van-field
v-model="form.startTime" :value="form.startTime"
required required
name="location" name="startTime"
label="任务开始时间" label="任务开始时间"
type="textarea" placeholder="请选择"
maxlength="255" @click="selectBeginTime('startTime')"
rows="1"
autosize
placeholder="请输入"
:rules="[{ required: true, message: '任务开始时间不能为空' }]" :rules="[{ required: true, message: '任务开始时间不能为空' }]"
/> />
<van-field <van-field
v-model="form.endTime" clickable
:value="form.endTime"
required required
name="location" name="endTime"
label="任务结束时间" label="任务结束时间"
type="textarea" @click="selectBeginTime('endTime')"
maxlength="255" placeholder="请选择"
rows="1"
autosize
placeholder="请输入"
:rules="[{ required: true, message: '任务结束时间不能为空' }]" :rules="[{ required: true, message: '任务结束时间不能为空' }]"
/> />
<van-field <van-field
clickable clickable
required required
name="control" name="workUserNames"
:value="form.control" :value="form.workUserNames"
label="执行人员" label="执行人员"
placeholder="请选择" placeholder="请选择"
@click="showControl = true" @click="getExecuteUser()"
:rules="[{ required: true, message: '执行人员不能为空' }]" :rules="[{ required: true, message: '执行人员不能为空' }]"
/> />
<van-popup v-model="showControl" position="bottom"> <!-- <van-popup v-model="showControl" position="bottom">
<van-picker <van-picker
show-toolbar show-toolbar
:columns="columnsControl" :columns="columnsControl"
@confirm="onConControl" @confirm="onConControl"
@cancel="showControl = false" @cancel="showControl = false"
/> />
</van-popup> -->
<van-field
required
clickable
name="approveUserName"
:value="form.approveUserName"
label="审批负责人"
placeholder="请选择"
@click="getLeaderUserList('approveUser')"
:rules="[{ required: true, message: '事审批负责人不能为空' }]"
/>
<van-popup v-model="showTrouble" position="bottom">
<van-picker
show-toolbar
value-key="nickName"
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</van-popup> </van-popup>
<van-popup v-model="show" position="bottom" :style="{ height: '100%' }"> <van-popup v-model="show" position="bottom" :style="{ height: '100%' }">
<!-- <selectPeople @onClose="onClose" @onSave="onSave"></selectPeople> --> <!-- <selectPeople @onClose="onClose" @onSave="onSave"></selectPeople> -->
</van-popup> </van-popup>
<van-popup v-model="riskModel" position="bottom" :style="{ height: '100%' }">
<div class="van-picker__toolbar" style="position: absolute;width: 100%;top: 0;">
<button type="button" class="van-picker__cancel" v-on:click="riskModel = false">取消</button
><button type="button" class="van-picker__confirm" @click="onRiskList(riskList)">确认</button>
</div>
<div style="display:flex;margin-top: 44px;">
<van-checkbox-group v-model="riskList" style="width: 100%;font-size: 18px;">
<van-checkbox
shape="square"
style="margin: 10px 0px;justify-content: center;"
v-for="item in riskModelList"
:key="item.id"
:name="item"
>{{ item[filedName] }}</van-checkbox
>
</van-checkbox-group>
</div>
</van-popup>
<!-- 选择时间弹出层 -->
<van-popup v-model="showTime" position="bottom">
<van-datetime-picker
type="datetime"
@confirm="onConTime"
@cancel="showTime = false"
:min-date="minDate"
v-model="currentDate"
/>
</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
...@@ -154,6 +193,8 @@ ...@@ -154,6 +193,8 @@
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
// import selectPeople from "@/views/riskTask/selectPeople/index.vue"; // import selectPeople from "@/views/riskTask/selectPeople/index.vue";
import { timestampToTime, generateId } from "@/utils/format";
import { getUserInfo, getLocalUserInfo, setLocalUserInfo} from '@/utils/userInfo'
import { getFun, postFun } from "@/service/table.js"; import { getFun, postFun } from "@/service/table.js";
// import { // import {
// getFormList, // getFormList,
...@@ -169,28 +210,6 @@ export default { ...@@ -169,28 +210,6 @@ export default {
components: { components: {
LHeader, LHeader,
}, },
activated() {
this.showSetRank = false; // 再次关闭弹出层 以防万一
if (this.$route.params.taskId) {
this.isShowreturnCause = true;
this.text = "风险上报退回";
this.taskId = this.$route.params.taskId;
this.postReturnEcho();
}
this.getList();
this.$bus.$on("riskLevelBus", (res) => {
this.showSetRank = false; // 再次关闭弹出层 以防万一
console.log(Boolean(res));
if (res) {
this.riskRank = res;
} else {
this.setRank = "";
}
// 销毁一下监听事件 不然会越加越多
this.$bus.$off("riskLevelBus");
});
},
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
if (to.name != "matrix-grad") { if (to.name != "matrix-grad") {
...@@ -203,14 +222,23 @@ export default { ...@@ -203,14 +222,23 @@ export default {
text: "创建任务", text: "创建任务",
id: "", id: "",
form:{ form:{
name:''
}, },
projectId: "", // 所属工程 projectId: "", // 所属工程
projectName: "", // 所属工程 projectName: "", // 所属工程
projectDirectorName: "", // 所属工程 projectDirectorName: "", // 所属工程
projectDirector: "", // 所属工程 projectDirector: "", // 所属工程
timeName: "", //
userPrefix: "", //
showProjectName: false, showProjectName: false,
riskModel: false,
filedName:'',
currentDate: new Date(),
minDate: new Date(),
showTime: false,
show: false, show: false,
riskList: [],
riskModelList: [],
columnsProjectName: [], columnsProjectName: [],
factor: "", //风险因素 factor: "", //风险因素
showFactor: false, showFactor: false,
...@@ -223,19 +251,14 @@ export default { ...@@ -223,19 +251,14 @@ export default {
columnsTrouble: [], columnsTrouble: [],
setRank: "", //风险定级 setRank: "", //风险定级
showSetRank: false, showSetRank: false,
columnsSetRank: ["矩阵式定级", "其他定级方式"],
riskRank: "", // 风险等级 riskRank: "", // 风险等级
showRiskRank: false, showRiskRank: false,
columnsRiskRank: ["重大风险", "较大风险", "一般风险", "较小风险" ],
showSetRankMode: false, // 是否显示定级方式 showSetRankMode: false, // 是否显示定级方式
setRankMode: "", // 定级方式文字 setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片 setRankModeImg: [], // 定级方式图片
location: "", //风险部位 location: "", //风险部位
control: "", //管控层级 control: "", //管控层级
showControl: false, showControl: false,
columnsControl: ["项目级", "企业级"],
mainDutyDept: "", // 主责部门
mainDutyDeptId: "",
showMainDutyDept: false, showMainDutyDept: false,
columnsMainDutyDept: [], columnsMainDutyDept: [],
mainDutyPeopLe: "", // 主责人员 mainDutyPeopLe: "", // 主责人员
...@@ -253,15 +276,134 @@ export default { ...@@ -253,15 +276,134 @@ export default {
}; };
}, },
created() { created() {
if (this.$route.params.taskId) { var userInfo=getUserInfo()
this.isShowreturnCause = true; this.form.userId=userInfo.userId
this.text = "风险上报退回"; this.form.userName=userInfo.userName
this.taskId = this.$route.params.taskId; this.form.deptName=userInfo.dept.deptName
this.postReturnEcho(); this.form.deptId=userInfo.dept.deptId
} getFun(`/risk/plan/project/list`).then((res) => {
this.columnsSource = res.data;
}
);
// this.getList(); // this.getList();
}, },
methods: { methods: {
// 确定时间的方法
onConTime(date) {
console.log('%c [ date ]-293', 'font-size:13px; background:pink; color:#bf2c9f;', date)
let time = timestampToTime(date, "DT1", true);
this.form[this.timeName] = time;
this.showTime = false;
},
// 计划开始时间
selectBeginTime(val) {
this.showTime = true;
this.timeName=val
this.currentDate = new Date();
},
getLeaderUserList(e){
if(!this.form.projectId){
this.$toast({
title: "提示",
message: "请选择关联项目!",
});
return false
}
this.userPrefix=e
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
getFun(`/risk/plan/user/list/${this.form.projectId}`).then(res => {
if (res.code == 200) {
this.columnsTrouble = res.data;
// 对数据进行赋值
this.$toast.clear();
this.showTrouble = true;
} else {
this.$toast.clear();
}
});
},
onRiskList(value) {
console.log('%c [ value ]-331', 'font-size:13px; background:pink; color:#bf2c9f;', value)
if(this.filedName=='nickName'){
this.form.workUserIds= this.filterField("userId",value).join()
this.form.workUserNames= this.filterField("nickName",value).join()
console.log('%c [ this.form.workUserNames ]-334', 'font-size:13px; background:pink; color:#bf2c9f;', this.form.workUserNames)
}else{
this.form.buildingIds= this.filterField("id",value).join()
this.form.buildingNames= this.filterField("name",value).join()
}
this.riskList=[]
this.riskModel = false;
// this.form[this.fieldName] = value.join();
},
getExecuteUser() {
if(!this.form.projectId){
this.$toast({
title: "提示",
message: "请选择关联项目!",
});
return false
}
this.filedName='nickName'
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
getFun(`/risk/plan/user/list/${this.form.projectId}`).then(res => {
if (res.code == 200) {
this.riskModelList = res.data;
// 对数据进行赋值
this.$toast.clear();
this.riskModel = true;
} else {
this.$toast.clear();
}
});
},
getRiskList() {
if(!this.form.projectId){
this.$toast({
title: "提示",
message: "请选择关联项目!",
});
return false
}
this.filedName='name'
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
getFun(`/risk/plan/building/list/${this.form.projectId}`).then(res => {
if (res.code == 200) {
this.riskModelList = res.data;
// 对数据进行赋值
this.$toast.clear();
this.riskModel = true;
} else {
this.$toast.clear();
}
});
},
filterField(value,arr){
var arrs=[]
arr.forEach(item=>{
arrs.push(item[value])
})
return arrs
},
async deleteFile(val, detail, key) { async deleteFile(val, detail, key) {
// console.log(val,detail) // console.log(val,detail)
if (val.fileId) { if (val.fileId) {
...@@ -281,15 +423,21 @@ export default { ...@@ -281,15 +423,21 @@ export default {
} }
}, },
onSubmit(values) { onSubmit(values) {
let url = "/riskMain/add"; this.$toast.loading({
postReAdd(url, formdata) message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
let url = "/risk/plan";
postFun(url, this.form)
.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);
}) })
.catch(() => { .catch(() => {
this.$toast.clear(); this.$toast.clear();
...@@ -329,27 +477,6 @@ export default { ...@@ -329,27 +477,6 @@ export default {
}); });
postriskConiCause(`/riskMain/edit/${this.taskId}`) postriskConiCause(`/riskMain/edit/${this.taskId}`)
.then((res) => { .then((res) => {
let data = res.data.riskMain;
let data1 = res.data.ResponsibilityMember;
this.id = data.id;
this.projectId = data.pId;
this.riskRank = data.riskLevel;
this.factor = data.riskFactor;
this.source = data.riskSource;
this.trouble = data.accidentType;
this.setRank = data.level;
this.setRankMode = data.grapingMethod;
this.location = data.riskPosition;
this.control = data.controlLevel;
this.mainDutyDeptId = data.responsibilityDept;
this.mainDutyPeopLeId = data.responsibilityMember;
this.administration = data.managementMeasures;
this.urgent = data.emergencyMeasure;
this.mainDutyPeopLe = data.mainDutyPeopLe;
this.mainDutyDept = data1.organizationName;
this.technology = data.technicalMeasures;
// urgentImg administrationImg technologyImg setRankModeImg
// 定级方式 // 定级方式
this.urgentImg = (res.data.imgsysFiles2 || []).map( this.urgentImg = (res.data.imgsysFiles2 || []).map(
(item) => { (item) => {
...@@ -408,17 +535,11 @@ export default { ...@@ -408,17 +535,11 @@ export default {
this.returnCause = res.data.reason; this.returnCause = res.data.reason;
//请求风险源 //请求风险源
postHdSource(`/riskMain/showSourceName?factorType=${this.factor}`).then( postHdSource(`/risk/plan/project/list`).then(
(res) => { (res) => {
this.columnsSource = res.data; this.columnsSource = res.data;
} }
); );
// 请求事故类型
postHdType(
`/riskMain/showaccidentType?factorType=${this.factor}&sourceName=${this.source}`
).then((res) => {
this.columnsTrouble = res.data;
});
}) })
.catch(() => { .catch(() => {
this.$toast.clear(); this.$toast.clear();
...@@ -452,38 +573,26 @@ export default { ...@@ -452,38 +573,26 @@ export default {
} }
); );
}, },
// 风险源 // 关联项目
onConSource(value) { onConSource(value) {
if (!value) { if (!value) {
this.showSource = false; this.showSource = false;
return; return;
} }
this.source = value.sourceName; this.form.projectId = value.id;
this.form.projectName = value.name;
this.showSource = false; this.showSource = false;
this.trouble = "";
// 请求事故类型
postHdType(
`/riskMain/showaccidentType?factorType=${this.factor}&sourceName=${this.source}`
).then((res) => {
this.columnsTrouble = res.data;
});
}, },
// 事故类型 // 项目负责人
onConTrouble(value) { onConTrouble(value) {
if (!value) { if (!value) {
this.showTrouble = false; this.showTrouble = false;
return; return;
} }
this.trouble = value.accidentType; this.form[this.userPrefix + "Id"] = value.userId;
this.form[this.userPrefix + "Name"] = value.nickName;
console.log('this.form :>> ', this.form);
this.showTrouble = false; this.showTrouble = false;
// 请求三个措施
postRiskShowMeasures(
`/riskMain/showmeasures?factorType=${this.factor}&sourceName=${this.source}&accidentType=${this.trouble}`
).then((res) => {
this.technology = res.data[0].measuresProject;
this.administration = res.data[0].measuresAdministration;
this.urgent = res.data[0].measuresEmergency;
});
}, },
// 风险定级 // 风险定级
onConSetRank(value) { onConSetRank(value) {
......
...@@ -6,9 +6,25 @@ ...@@ -6,9 +6,25 @@
</van-sticky> </van-sticky>
<div style="margin-bottom: 1.5rem;"> <div style="margin-bottom: 1.5rem;">
<van-grid :column-num="3" style="background-color: #fff;"> <van-grid :column-num="3" style="background-color: #fff;">
<van-grid-item v-for="value in 5" :key="value"> <van-grid-item >
<div>发起人员:</div> <div>发起人员:</div>
<div>李小明</div> <div>{{messageList.createUserName}}</div>
</van-grid-item>
<van-grid-item >
<div>项目负责人:</div>
<div>{{messageList.leaderUserName}}</div>
</van-grid-item>
<van-grid-item >
<div>任务状态:</div>
<div>{{messageList.status}}</div>
</van-grid-item>
<van-grid-item >
<div>开始时间:</div>
<div>{{timestampToTimes(messageList.startTime)||messageList.startTime}}</div>
</van-grid-item>
<van-grid-item >
<div>结束时间:</div>
<div>{{timestampToTimes(messageList.endTime)||messageList.endTime}}</div>
</van-grid-item> </van-grid-item>
</van-grid> </van-grid>
<van-steps :active="active" active-icon="success" active-color="#38f" style="margin: 0.26rem 0;"> <van-steps :active="active" active-icon="success" active-color="#38f" style="margin: 0.26rem 0;">
...@@ -29,47 +45,53 @@ ...@@ -29,47 +45,53 @@
> >
<van-field <van-field
readonly readonly
name="creatBy" name="createUserName"
:value="form.creatBy" :value="form.createUserName"
label="创建人员" label="创建人员"
input-align="right"
:rules="[{ required: true, message: '创建人员不能为空' }]" :rules="[{ required: true, message: '创建人员不能为空' }]"
/> />
<van-field <van-field
readonly readonly
name="creatUnit" name="createDeptName"
:value="form.creatUnit" :value="form.createDeptName"
label="创建单位" label="创建单位"
input-align="right"
:rules="[{ required: true, message: '创建单位不能为空' }]" :rules="[{ required: true, message: '创建单位不能为空' }]"
/> />
<van-field <van-field
readonly readonly
name="taskName" name="projectName"
:value="form.taskName" :value="form.projectName"
label="任务名称" label="任务名称"
input-align="right"
:rules="[{ required: true, message: '任务名称不能为空' }]" :rules="[{ required: true, message: '任务名称不能为空' }]"
/> />
<van-field <van-field
readonly readonly
name="source" name="projectName"
:value="form.source" :value="form.projectName"
label="关联项目" label="关联项目"
input-align="right"
:rules="[{ required: true, message: '关联项目不能为空' }]" :rules="[{ required: true, message: '关联项目不能为空' }]"
/> />
<van-field <van-field
readonly readonly
name="taskName" name="buildingNames"
:value="form.taskName" :value="form.buildingNames"
label="评估楼栋" label="评估楼栋"
input-align="right"
:rules="[{ required: true, message: '评估楼栋不能为空' }]" :rules="[{ required: true, message: '评估楼栋不能为空' }]"
/> />
<van-field <van-field
readonly readonly
name="trouble" name="leaderUserName"
:value="form.trouble" :value="form.leaderUserName"
label="项目负责人" label="项目负责人"
input-align="right"
:rules="[{ required: true, message: '事故类型不能为空' }]" :rules="[{ required: true, message: '事故类型不能为空' }]"
/> />
...@@ -79,10 +101,7 @@ ...@@ -79,10 +101,7 @@
readonly readonly
name="location" name="location"
label="任务开始时间" label="任务开始时间"
type="textarea" input-align="right"
maxlength="255"
rows="1"
autosize
:rules="[{ required: true, message: '任务开始时间不能为空' }]" :rules="[{ required: true, message: '任务开始时间不能为空' }]"
/> />
...@@ -91,19 +110,16 @@ ...@@ -91,19 +110,16 @@
readonly readonly
name="location" name="location"
label="任务结束时间" label="任务结束时间"
type="textarea" input-align="right"
maxlength="255"
rows="1"
autosize
:rules="[{ required: true, message: '任务结束时间不能为空' }]" :rules="[{ required: true, message: '任务结束时间不能为空' }]"
/> />
<van-field <van-field
clickable clickable
required name="workUserNames"
name="control" :value="form.workUserNames"
:value="form.control"
label="执行人员" label="执行人员"
input-align="right"
:rules="[{ required: true, message: '执行人员不能为空' }]" :rules="[{ required: true, message: '执行人员不能为空' }]"
/> />
</van-form> </van-form>
...@@ -213,6 +229,7 @@ ...@@ -213,6 +229,7 @@
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import { timestampToTime, generateId } from "@/utils/format";
import { getFun, postFun } from "@/service/table.js"; import { getFun, postFun } from "@/service/table.js";
export default { export default {
name:'risk-confirme', name:'risk-confirme',
...@@ -224,28 +241,8 @@ ...@@ -224,28 +241,8 @@
text: "任务单", text: "任务单",
searchValue: "", searchValue: "",
isHaveNews: false, isHaveNews: false,
messageList: [ messageList: [],
{ riskLogList:[],
title:'XX项目评估任务单',
time:'2022-12-12',
name:'Mr.周',
state:1
}
],
riskLogList:[
{
completedTime:'审批通过',
startTime:'2022-12-12',
approvalUserName:'Mr.周',
taskName:'审批负责人'
},
{
completedTime:'审批通过',
startTime:'2022-12-12',
approvalUserName:'Mr.周',
taskName:'审批负责人'
},
],
Loop: "", // 定时器 Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层, showIndex: null, // 是否显示遮罩层,
active: 0, active: 0,
...@@ -257,9 +254,13 @@ ...@@ -257,9 +254,13 @@
}; };
}, },
created() { created() {
// this.postList();s var planId=this.$route.params.id
this.postList(planId);
}, },
methods: { methods: {
timestampToTimes(time){
return timestampToTime(new Date(time),"DT2", true)
},
performTasks(){ performTasks(){
this.$router.push({ this.$router.push({
name: "riskInherent", name: "riskInherent",
...@@ -276,23 +277,20 @@ ...@@ -276,23 +277,20 @@
}, },
}) })
}, },
postList(select = "") { postList(id) {
this.$toast.loading({ this.$toast.loading({
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0, duration: 0,
}); });
let formdata = new FormData(); getFun(`/risk/plan/details/${id}`)
formdata.append("select", select);
postFun(this.tabs[this.active]['api'], formdata)
.then((res) => { .then((res) => {
console.log('%c [ res ]-309', 'font-size:13px; background:pink; color:#bf2c9f;', res)
this.$toast.clear(); this.$toast.clear();
this.messageList =res.data||res.rows; this.messageList =res.data||res.rows;
// 判断有无数据返回 this.form= this.messageList.detailsDto
if (this.messageList.length == 0) { console.log('%c [ messageList ]-292', 'font-size:13px; background:pink; color:#bf2c9f;', this.messageList)
this.isHaveNews = true;
}
}) })
.catch(() => { .catch(() => {
this.$toast.clear(); this.$toast.clear();
......
...@@ -40,17 +40,17 @@ ...@@ -40,17 +40,17 @@
:key="index" :key="index"
@click="touchstart(index, item)" @click="touchstart(index, item)"
> >
<div style="font-size: 0.45rem;padding: 5px 0;">{{item.title}}</div> <div style="font-size: 0.45rem;padding: 5px 0;">{{item.name}}</div>
<van-row gutter=""> <van-row gutter="">
<van-col span="17"> <van-col span="17">
<van-row gutter=""> <van-row gutter="">
<van-col span="9">发起时间:</van-col> <van-col span="9">发起时间:</van-col>
<van-col span="15">{{ item.time}}</van-col> <van-col span="15">{{timestampToTimes(item.startTime)||item.startTime }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="9">处理人员:</van-col> <van-col span="9">处理人员:</van-col>
<van-col span="15">{{ item.name }}</van-col> <van-col span="15">{{ item.leaderUserName }}</van-col>
</van-row> </van-row>
</van-col> </van-col>
<van-col span="7" :style="{'color':item.state == 1 ? '#0069e5':'#03b615'}"> <van-col span="7" :style="{'color':item.state == 1 ? '#0069e5':'#03b615'}">
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import { timestampToTime, generateId } from "@/utils/format";
import { getFun, postFun } from "@/service/table.js"; import { getFun, postFun } from "@/service/table.js";
// import { postriskConList } from "@/service/risk"; // import { postriskConList } from "@/service/risk";
export default { export default {
...@@ -115,13 +116,6 @@ ...@@ -115,13 +116,6 @@
searchValue: "", searchValue: "",
isHaveNews: false, isHaveNews: false,
messageList: [ messageList: [
{
title:'XX项目评估任务单',
time:'2022-12-12',
name:'Mr.周',
state:1,
id:12
}
], ],
Loop: "", // 定时器 Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层, showIndex: null, // 是否显示遮罩层,
...@@ -129,19 +123,22 @@ ...@@ -129,19 +123,22 @@
tabs: [ tabs: [
{ {
title: "未执行", title: "未执行",
api: "/riskConfirm/list", api: "/risk/plan/create/list?status=finish",
}, },
{ {
title: "已执行", title: "已执行",
api: "/riskConfirm/finishList", api: "/risk/plan/create/list?status=running",
}, },
], ],
}; };
}, },
created() { created() {
// this.postList();s this.postList();
}, },
methods: { methods: {
timestampToTimes(time){
return timestampToTime(new Date(time),"DT1", true)
},
handadd(){ handadd(){
this.$router.push({ this.$router.push({
name: "riskAdd", name: "riskAdd",
...@@ -157,9 +154,9 @@ ...@@ -157,9 +154,9 @@
loadingType: "spinner", loadingType: "spinner",
duration: 0, duration: 0,
}); });
let formdata = new FormData(); // let formdata = new FormData();
formdata.append("select", select); // formdata.append("select", select);
postFun(this.tabs[this.active]['api'], formdata) getFun(this.tabs[this.active]['api'])
.then((res) => { .then((res) => {
this.$toast.clear(); this.$toast.clear();
this.messageList =res.data||res.rows; this.messageList =res.data||res.rows;
......
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