Commit 9ff33853 authored by 杨帆's avatar 杨帆

Dev yf'

parent a9115a80
......@@ -15689,7 +15689,7 @@
},
"vue-lazyload": {
"version": "1.2.3",
"resolved": "https://registry.npmmirror.com/vue-lazyload/-/vue-lazyload-1.2.3.tgz",
"resolved": "https://registry.npmjs.org/vue-lazyload/-/vue-lazyload-1.2.3.tgz",
"integrity": "sha512-DC0ZwxanbRhx79tlA3zY5OYJkH8FYp3WBAnAJbrcuoS8eye1P73rcgAZhyxFSPUluJUTelMB+i/+VkNU/qVm7g=="
},
"vue-loader": {
......
<template>
<div style="width:100%">
<LHeader :text="text"></LHeader>
<!-- 搜索 -->
<div class="content-wrap">
<!-- <div class="search-wrap">
<van-search v-model="searchVal" placeholder="搜索" />
</div> -->
<div class="upStep" v-show="showPre">
<van-cell-group>
<div class="upStep-content">{{ deptName }}</div>
<div class="upStep-btn"><span @click="goBack">返回上级</span></div>
</van-cell-group>
</div>
<!-- 部门列表 -->
<div class="dept-list-wrap">
<van-cell-group>
<van-radio-group v-model="result" @change="changeRadio">
<van-cell
style="display:flex"
v-for="item in deptList"
clickable
:key="item.deptId"
>
<van-radio :name="item.deptId" @click="selectDept(item)">
<span>{{ item.deptName }}</span>
</van-radio>
<template #right-icon>
<van-icon
name="arrow"
class="arrow-icon"
@click="nextDept(item)"
/>
</template>
</van-cell>
</van-radio-group>
</van-cell-group>
</div>
</div>
<!-- 底部信息 -->
<footer class="footer">
<van-cell-group>
<div class="selected">
<span class="selected-title">已选择 ({{ result ? 1 : 0 }}) :</span>
<label>{{ resultName }}</label>
</div>
<!-- <div class="operate">
<van-button
size="small"
ttype="info"
plain
native-type="button"
style="border-radius: 5px; background-color: #f0f1f5;"
@click.native="cancel"
>取消
</van-button>
<van-button
size="small"
type="info"
native-type="button"
style="margin:0 10px 0 20px;border-radius: 5px;"
@click.native="save"
>保存
</van-button>
</div> -->
</van-cell-group>
</footer>
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table";
import { getUserInfo } from "@/utils/userInfo";
import { debounce } from "@/utils/common.js";
import { Toast } from "vant";
export default {
name: "select-people",
components: {
LHeader
},
created() {
this.getInsideUser(getUserInfo().secondaryUnit);
},
data() {
return {
text: "选择组织",
personName: "",
deptId: 0, // 部门id
storageList: [], // 存储上级部门
deptName: "",
showPre: false,
result: "",
resultName: "",
dutyList: [],
searchVal: "",
deptList: [], // 部门
allDeptList: [], // 部门
isFirstSearch: true
};
},
methods: {
changeRadio() {
this.resultName = this.allDeptList.find(
item => item.deptId == this.result
).deptName;
},
// 查询内部人员
getInsideUser(id, val) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
getFun("/risk/plan/dept/list").then(res => {
this.allDeptList = res.data;
this.deptList = this.allDeptList.filter(item => item.parentId == 0);
console.log(res.data);
});
},
// // 待搜索框内容发生变化
// onInput: debounce(function() {
// if (this.isFirstSearch) {
// this.getInsideUser(getUserInfo().secondaryUnit, this.searchVal);
// } else {
// this.getInsideUser(this.deptId, this.searchVal);
// }
// }, 500),
nextDept(data) {
var depts = this.allDeptList.filter(item => item.parentId == data.deptId);
if (!depts || depts.length <= 0) {
Toast({
message: "组织下暂无数据",
position: "top"
});
return;
}
this.deptList = depts;
if (data.deptId != 0) this.showPre = true;
else this.showPre = false;
this.deptName = data.deptName;
this.deptId = data.deptId;
console.log(this.deptList);
// this.deptId = data.deptId;
// this.searchVal = "";
// this.deptName = data.deptName;
// this.isFirstSearch = false; // 如果点击过部门,则不必再用死deptId了
// this.storageList.push({ deptId: data.parentId, deptName: data.deptName });
// this.getInsideUser(this.deptId);
},
goBack() {
var parentId = this.allDeptList.find(item => item.deptId == this.deptId)
.parentId;
console.log(parentId);
if (parentId != 0) {
this.showPre = true;
var dept = this.allDeptList.find(item => item.deptId == parentId);
this.nextDept(dept);
} else {
this.deptList = this.allDeptList.filter(item => item.parentId == 0);
this.showPre = false;
}
},
selectDept(data) {
// 先把数组清空 然后再放
this.dutyList = [];
this.dutyList.push({ userId: data.userId, userName: data.userName });
},
save() {
// 把数据存到 session 的内部人员数组中
// 先取出session中的值
let obj = JSON.parse(sessionStorage.getItem("personObj"));
obj.user = this.dutyList;
// 再次存到session中
sessionStorage.setItem("personObj", JSON.stringify(obj));
// 可以见一个公共的字段 存储以后需要的人的信息
history.go(-1);
},
cancel() {
this.$router.go(-1);
}
}
};
</script>
<style lang="less" scoped>
/* @import url(); 引入css类 */
// 搜索
.content-wrap {
padding-bottom: 2.666667rem;
background-color: #f0f1f5;
width: 100%;
}
.search-wrap {
margin: 0.26667rem;
.van-search {
border-radius: 5px;
padding: 5px 12px;
}
.van-search__content {
background-color: #ffffff;
}
}
.upStep {
.van-cell-group {
display: flex;
height: 1.2rem;
align-items: center;
.upStep-btn {
width: 25%;
text-align: center;
span {
width: 1.866667rem;
background-color: #1989fa;
text-align: center;
display: inline-block;
color: white;
height: 0.8rem;
line-height: 0.8rem;
font-size: 0.346667rem;
border-radius: 0.08rem;
}
}
.upStep-content {
width: 75%;
height: 0.8rem;
line-height: 0.8rem;
padding-left: 0.42667rem;
box-sizing: border-box;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.dept-list-wrap {
margin-top: 0.266667rem;
}
.people-wrap {
margin-top: 0.266667rem;
/deep/ .van-radio__label {
display: flex;
align-items: center;
}
.dept-name {
margin-left: 10px;
font-size: 12px;
color: #a3a4a6;
margin-top: 1px;
}
}
.footer {
width: 100%;
height: 2.4rem;
z-index: 9;
position: fixed;
bottom: 0px;
box-shadow: 0px 8px 15px #000;
.van-cell-group {
height: 100%;
.selected {
height: 1.066667rem;
display: flex;
align-items: center;
padding-left: 10px;
border-bottom: 1px solid #cacbcb;
.selected-title {
color: #4187f7;
}
.selected-content {
width: 80%;
padding-left: 10px;
box-sizing: border-box;
}
}
.operate {
height: 1.333333rem;
display: flex;
justify-content: flex-end;
align-items: center;
.van-button {
width: 1.6rem;
}
}
}
}
</style>
This diff is collapsed.
......@@ -98,8 +98,8 @@ export default {
planId: 0,
buildingId: 0,
buildingName: "",
value1: 1,
value2: 1,
value1: 0,
value2: 0,
option1: [],
option2: [],
isHaveNews: false,
......@@ -175,6 +175,7 @@ export default {
getFun(`/risk/plan/floor/list/${id}`)
.then(res => {
this.option1 = this.changeData(res.data);
this.value1 = res.data[0].id || 0;
resolve(res.data);
})
.catch(() => {
......@@ -187,6 +188,7 @@ export default {
getFun(`/risk/plan/room/list/${id}`)
.then(res => {
this.option2 = this.changeData(res.data);
this.value2 = res.data[0].id || 0;
resolve(res.data);
})
.catch(() => {
......
......@@ -34,15 +34,15 @@
</van-grid-item>
</van-grid>
<van-steps
:active="active"
:active="phase"
active-icon="success"
active-color="#38f"
style="margin: 0.26rem 0;"
>
<van-step>任务发起</van-step>
<van-step>风险评估</van-step>
<van-step>评估审核</van-step>
<van-step>项目完成</van-step>
<van-step name="1">任务发起</van-step>
<van-step name="2">风险评估</van-step>
<van-step name="3">评估审核</van-step>
<van-step name="4">项目完成</van-step>
</van-steps>
<van-tabs
v-model="active"
......@@ -100,13 +100,31 @@
:rules="[{ required: true, message: '评估楼栋不能为空' }]"
/>
<van-field
readonly
name="deptId"
:value="form.deptId"
label="评估小组选择"
input-align="right"
:rules="[{ required: true, message: '评估小组不能为空' }]"
/>
<van-field
readonly
name="leaderUserName"
:value="form.leaderUserName"
label="项目负责人"
label="评估小组组长"
input-align="right"
:rules="[{ required: true, message: '事故类型不能为空' }]"
:rules="[{ required: true, message: '评估小组组长不能为空' }]"
/>
<van-field
clickable
name="workUserNames"
:value="form.workUserNames"
label="评估成员"
input-align="right"
:rules="[{ required: true, message: '评估成员不能为空' }]"
/>
<van-field
......@@ -136,15 +154,6 @@
input-align="right"
:rules="[{ required: true, message: '任务结束时间不能为空' }]"
/>
<van-field
clickable
name="workUserNames"
:value="form.workUserNames"
label="执行人员"
input-align="right"
:rules="[{ required: true, message: '执行人员不能为空' }]"
/>
</van-form>
</van-tab>
<van-tab title="风险清单"> </van-tab>
......@@ -283,6 +292,7 @@ export default {
Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层,
active: 0,
phase: 1,
form: {},
tabs: []
};
......@@ -329,6 +339,7 @@ export default {
.then(res => {
this.$toast.clear();
this.messageList = res.data || res.rows;
console.log(this.messageList);
this.form = this.messageList.detailsDto;
this.riskLogList = this.messageList.approveListDtos;
})
......
......@@ -3,7 +3,7 @@ module.exports = {
devServer: {
open: true,
host: 'localhost',
port: 8080,
port: 8081,
https: false,
//以上的ip和端口是我们本机的;下面为需要跨域的
proxy: { //配置跨域
......@@ -11,7 +11,7 @@ module.exports = {
// target: 'http://192.168.4.232:8080/', //这里是后台的地址
// target: 'http://192.168.15.124:8080/', //这里是杨帆的地址
// target: 'http://192.168.10.137:8080/', //这里是昊哥的地址
target: 'http://192.168.10.36:8080/', //这里是后台的地址
target: 'http://localhost:8080/', //这里是后台的地址
ws: true,
changOrigin: true, //允许跨域
// logLevel: 'debug', // 显示代理调试信息
......@@ -19,14 +19,14 @@ module.exports = {
// '^/app-api': '' //请求的时候使用这个api就可以
// }
},
// '/ps_ceninss': {
// target: 'http://192.168.3.80:8080', //这里是后台的地址
// ws: true,
// changOrigin: true, //允许跨域
// pathRewrite: {
// '^/ps_ceninss': 'ps_ceninss' //请求的时候使用这个api就可以
// }
// }
// '/ps_ceninss': {
// target: 'http://192.168.3.80:8080', //这里是后台的地址
// ws: true,
// changOrigin: true, //允许跨域
// pathRewrite: {
// '^/ps_ceninss': 'ps_ceninss' //请求的时候使用这个api就可以
// }
// }
}
}
}
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