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>
This diff is collapsed.
...@@ -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