Commit 14b8cb46 authored by p-wanping.song's avatar p-wanping.song

Merge branch 'develop' of http://git.censoft.com.cn/rongtong/rongtong-app into develop

parents fb278052 46af6280
......@@ -18,7 +18,7 @@
> -->
<van-checkbox
style="margin: 0px 10px;"
v-for="(item, index) in listdata"
v-for="(item, index) in listDataCopy"
:name="item.dictLabel"
:key="index"
@click="selData(item)"
......@@ -68,7 +68,10 @@ export default {
components: {
// LHeader
},
created() {},
created() {
this.listDataCopy = this.listdata;
},
data() {
return {
text: "选择人员",
......@@ -80,6 +83,7 @@ export default {
loading: false,
finished: false,
projectList: [],
listDataCopy: [],
itemSel: {}
};
},
......@@ -90,7 +94,10 @@ export default {
this.pageNum = 1;
this.finished = false;
this.loading = true;
this.getInsideUser();
// this.getInsideUser();
this.listDataCopy = this.listdata.filter(item => {
return item.dictLabel.indexOf(this.searchVal) > -1;
});
}, 800),
selData(e) {
......
......@@ -122,7 +122,8 @@
<script>
import { GridLayout, GridItem } from "vue-grid-layout";
import screenfull from "screenfull";
import { Toast } from "vant";
import { Toast, Dialog } from "vant";
import { debounce } from "@/utils/common.js";
import { getFun, postFun } from "@/service/table.js";
// 动态添加/删除
export default {
......@@ -134,6 +135,7 @@ export default {
data() {
return {
text: "房间位置绘制工具",
isabled: true,
layout: [
// { x: 0, y: 0, w: 2, h: 3, i: "1",name: "办公室1",c:'#FF4433',isDraggable:false,isResizable:false,},
// { x: 2, y: 0, w: 2, h: 3, i: "2",name: "办公室2",c:'#FF9800',isDraggable:false,isResizable:false},
......@@ -159,7 +161,8 @@ export default {
isBase: false,
baseName: "",
baseArr: [],
layoutData: []
layoutData: [],
layoutDataStr: []
};
},
props: {
......@@ -267,6 +270,7 @@ export default {
if (res.code == 200) {
this.layout = [];
this.layoutData = res.data;
this.layoutDataStr = JSON.stringify(this.layoutData);
res.data.forEach(item => {
item.position = JSON.parse(item.position);
item.position.i = item.id;
......@@ -275,24 +279,10 @@ export default {
item.position.isDraggable = false;
item.position.isResizable = false;
}
if (!this.isViews ) {
if (!this.isViews) {
//添加页面不显示颜色
item.position.c = "#e6e5e5";
} else {
/**
* 根据风险评分来匹配相应的颜色
* score 风险评分字段
*/
// item.score = Number(item.score)
// if (item.score>=21 && item.score <= 27) { //优
// item.position.c = this.colorList[3]
// }else if(item.score>=14 && item.score <=20){ //良
// item.position.c = this.colorList[2]
// }else if (item.score>=7&& item.score <= 13) { //中
// item.position.c = this.colorList[1]
// }else if (item.score>=0 && item.score <= 6) { //差
// item.position.c = this.colorList[0]
// }
item.position.c = item.color;
}
this.layout.push(item.position);
......@@ -317,14 +307,6 @@ export default {
},
// 增加
addItem() {
if (this.layout.find(item => item.i == "")) {
Toast.fail({
title: "提示",
forbidClick: true,
message: "请先点击确定,保存当前房间信息"
});
return;
}
this.roomType = "";
this.roomName = "";
this.title = "创建房间";
......@@ -334,14 +316,6 @@ export default {
},
// 添加其他
addOther() {
if (this.layout.find(item => item.i == "")) {
Toast.fail({
title: "提示",
forbidClick: true,
message: "请先点击确定,保存当前房间信息"
});
return;
}
this.isRoom = false;
this.isBase = false;
this.roomType = "";
......@@ -351,27 +325,25 @@ export default {
},
// 删除
removeItem(val) {
if (val == "") {
const index = this.layout.map(item => item.i).indexOf(val);
this.layout.splice(index, 1);
return;
}
this.$dialog
.confirm({
title: "提示",
message: "是否删除"
})
.then(() => {
postFun("/ledger/room/delete/" + val)
.then(res => {
if (res.code == 200) {
Toast.success("删除成功");
this.getRoomInfo();
}
})
.catch(err => {
console.log("err==>>", err);
});
console.log(this.layout, val);
const index = this.layout.map(item => item.i).indexOf(val);
this.layout.splice(index, 1);
this.layoutData.splice(index, 1);
// postFun("/ledger/room/delete/" + val)
// .then(res => {
// if (res.code == 200) {
// Toast.success("删除成功");
// this.getRoomInfo();
// }
// })
// .catch(err => {
// });
})
.catch(() => {
// on cancel
......@@ -379,14 +351,6 @@ export default {
},
//添加基础设施
addBase() {
if (this.layout.find(item => item.i == "")) {
Toast.fail({
title: "提示",
forbidClick: true,
message: "请先点击确定,保存当前房间信息"
});
return;
}
this.roomType = "";
this.roomName = "";
this.title = "添加基础设备";
......@@ -396,37 +360,72 @@ export default {
},
// 移动后的事件
movedEvent(i, newX, newY) {
this.layOutItem.x = newX;
this.layOutItem.y = newY;
// console.log(this.layOutItem, "movedEvent");
// this.layOutItem.x = newX;
// this.layOutItem.y = newY;
// console.log('layOutItem==>>',this.layOutItem)
// console.log('this.layout==>>',this.layout)
},
// 调整大小后的事件
resizedEvent: function(i, newH, newW) {
this.layOutItem.w = newW;
this.layOutItem.h = newH;
// console.log(this.layOutItem, "resizedEvent");
// this.layOutItem.w = newW;
// this.layOutItem.h = newH;
// console.log('layOutItem==>>',this.layOutItem)
// console.log('this.layout==>>',this.layout)
},
//关闭
close() {
history.go(-1);
this.layoutData.forEach(item => {
if (
typeof item.position == "object" &&
Object.prototype.toString.call(item.position) === "[object Object]"
) {
item.position = JSON.stringify(item.position);
}
});
this.$dialog
.confirm({
title: "提示",
message: "是否保存已修改内容?"
})
.then(() => {
this.confim();
history.go(-1);
// on confirm
})
.catch(() => {
history.go(-1);
// on cancel
});
},
//edger/room/update/batch
// 确定 执行批量编辑保存
confim() {
// if (this.roomName == '') {
// Toast.fail({
// title: '提示',
// forbidClick: true,
// message: '请先添加房间!',
// })
// return
// }
confim: debounce(function() {
this.$toast.loading({
message: "处理中...",
forbidClick: true,
loadingType: "spinner",
duration: 3
});
//修改房间后返回清掉房间的值
var inherenForm = JSON.parse(sessionStorage.getItem("inherenForm"));
if (inherenForm) {
inherenForm.roomName = "";
inherenForm.roomId = "";
sessionStorage.setItem("inherenForm", JSON.stringify(inherenForm));
}
//保存
let data = this.layoutData;
this.layoutData.forEach(item => {
item.position = JSON.stringify(item.position);
data.forEach(item => {
if (
typeof item.position == "object" &&
Object.prototype.toString.call(item.position) === "[object Object]"
) {
item.position = JSON.stringify(item.position);
}
});
console.log("data==>>", data);
postFun("/ledger/room/update/batch", data)
.then(res => {
if (res.code == 200) {
......@@ -437,9 +436,10 @@ export default {
.catch(err => {
console.log("err==>>", err);
});
},
}),
//保存房间名称
saveRoomName() {
// this.confim();
if (this.roomName == "") {
Toast.fail({
title: "提示",
......@@ -448,13 +448,23 @@ export default {
});
return;
}
console.log(this.layout);
var i =
this.layout && this.layout.length > 0
? Math.max.apply(
Math,
this.layout.map(item => {
return item.id;
})
) + 1
: 1;
this.layOutItem = {
x: (this.layout.length * 2) % (this.colNum || 12),
y: this.layout.length + (this.colNum / 2 || 12),
w: 2,
h: 3,
i: "",
i: i,
id: i,
name: this.roomName,
c: "#e6e5e5",
type: this.isRoom
......@@ -466,29 +476,30 @@ export default {
isResizable: true
};
this.layout.push(this.layOutItem);
// console.log('layOutItem==>>',this.layOutItem)
let data = {
floorId: this.$route.params.floorId ? this.$route.params.floorId : "18",
name: this.roomName,
position: JSON.stringify(this.layOutItem),
position: this.layOutItem,
roomType: this.isRoom
? this.roomType
: this.isBase
? "基础设施"
: "9999"
};
postFun("/ledger/room/save", data)
.then(res => {
if (res.code == 200) {
// Toast.success('保存成功');
this.getRoomInfo();
this.roomType = "";
this.roomName = "";
}
})
.catch(err => {
console.log("err==>>", err);
});
this.layoutData.push(data);
console.log(this.layoutData, this.layout, "111111111111");
// postFun("/ledger/room/save", data)
// .then(res => {
// if (res.code == 200) {
// // Toast.success('保存成功');
// this.getRoomInfo();
// this.roomType = "";
// this.roomName = "";
// }
// })
// .catch(err => {
// });
},
cancelDialog() {
this.roomType = "";
......
......@@ -586,6 +586,7 @@
:style="{ height: '100%' }"
>
<selectFloor
v-if="ShowfloorList"
:listdata="floorSource"
@closeSlect="closeSlectfloor"
@saveSlect="saveSlectfloor"
......@@ -595,6 +596,7 @@
<!-- 单选弹出层 -->
<van-popup v-model="showSelect" position="bottom">
<van-picker
v-if="showSelect"
show-toolbar
value-key="dictValue"
:columns="columnsData"
......@@ -609,6 +611,7 @@
:style="{ height: '100%' }"
>
<selectList
v-if="showCheckSelect"
:listdata="columnsCheckData"
@closeSlect="showCheckSelect = false"
@saveSlect="saveCheckSelect"
......@@ -618,6 +621,7 @@
<!-- 房间弹出层 -->
<van-popup v-model="showSource" position="bottom">
<van-picker
v-if="showSource"
show-toolbar
value-key="name"
:columns="columnsSource"
......@@ -655,7 +659,10 @@
</button>
</div>
<div style="display:flex;margin-top: 44px;">
<selectDept @changeDept="changeDept"></selectDept>
<selectDept
v-if="measuresDept"
@changeDept="changeDept"
></selectDept>
</div>
</van-popup>
<!-- 管控责任人 -->
......
......@@ -595,6 +595,7 @@
:style="{ height: '100%' }"
>
<selectList
v-if="showCheckSelect"
:listdata="columnsCheckData"
@closeSlect="showCheckSelect = false"
@saveSlect="saveCheckSelect"
......@@ -603,7 +604,7 @@
<!-- 房间弹出层 -->
<van-popup v-model="showSource" position="bottom">
<van-picker
<van-picker v-if="showSource"
show-toolbar
value-key="name"
:columns="columnsSource"
......@@ -966,6 +967,13 @@ export default {
this.userPrefix = name;
},
seletRoom(name) {
if (!this.form.floorId) {
this.$toast({
title: "提示",
message: "请选择所属楼层!"
});
return false;
}
this.$toast.loading({
message: "加载中...",
forbidClick: true,
......@@ -1257,6 +1265,13 @@ export default {
},
//添加房间
tjfjClcik() {
if (!this.form.floorId) {
this.$toast({
title: "提示",
message: "请选择所属楼层!"
});
return false;
}
this.$router.push({
name: "riskView",
params: {
......
......@@ -158,14 +158,15 @@
/>
已采取的管控措施
</div>
<van-field
label="技术措施"
v-model="form.measuresProject"
name="measuresProject"
type="textarea"
rows="3"
autosize
placeholder="请输入">
<van-field
label="技术措施"
v-model="form.measuresProject"
name="measuresProject"
type="textarea"
rows="3"
autosize
placeholder="请输入"
>
</van-field>
<van-field name="measuresProjectFile[]" label="技术措施附件">
<template #input>
......@@ -200,13 +201,15 @@
</van-uploader>
</template>
</van-field>
<van-field label="管理措施"
v-model="form.measuresAdministration"
name="measuresAdministration"
type="textarea"
rows="3"
autosize
placeholder="请输入">
<van-field
label="管理措施"
v-model="form.measuresAdministration"
name="measuresAdministration"
type="textarea"
rows="3"
autosize
placeholder="请输入"
>
</van-field>
<van-field name="measuresAdministrationFile[]" label="管理措施附件">
<template #input>
......@@ -241,13 +244,15 @@
</van-uploader>
</template>
</van-field>
<van-field label="应急措施"
v-model="form.measuresEmergency"
name="measuresEmergency"
type="textarea"
rows="3"
autosize
placeholder="请输入">
<van-field
label="应急措施"
v-model="form.measuresEmergency"
name="measuresEmergency"
type="textarea"
rows="3"
autosize
placeholder="请输入"
>
</van-field>
<van-field name="measuresEmergencyFile[]" label="应急措施附件">
<template #input>
......@@ -442,6 +447,7 @@
:style="{ height: '100%' }"
>
<selectFloor
v-if="ShowfloorList"
:listdata="floorSource"
@closeSlect="closeSlectfloor"
@saveSlect="saveSlectfloor"
......@@ -451,6 +457,7 @@
<!-- 单选弹出层 -->
<van-popup v-model="showSelect" position="bottom">
<van-picker
v-if="showSelect"
show-toolbar
value-key="dictValue"
:columns="columnsData"
......@@ -465,6 +472,7 @@
:style="{ height: '100%' }"
>
<selectList
v-if="showCheckSelect"
:listdata="columnsCheckData"
@closeSlect="showCheckSelect = false"
@saveSlect="saveCheckSelect"
......@@ -474,6 +482,7 @@
<!-- 房间弹出层 -->
<van-popup v-model="showSource" position="bottom">
<van-picker
v-if="showSource"
show-toolbar
value-key="name"
:columns="columnsSource"
......@@ -655,14 +664,13 @@ export default {
this.existingId = this.$route.params.existingId;
this.inherentId = this.form.inherentId =
this.$route.params.inherentId || sessionStorage.getItem("inherentId");
},
mounted() {
if (sessionStorage.getItem("presentForm")) {
this.form = JSON.parse(sessionStorage.getItem("presentForm"));
this.form.level = sessionStorage.getItem("level");
sessionStorage.removeItem('presentForm')
}else{
sessionStorage.removeItem("presentForm");
} else {
this.postReturnEcho();
}
},
......@@ -751,7 +759,15 @@ export default {
this.form.planId = res.data.planId;
/* 下面这些值还要可以输入,用上面的方法赋值后没有办法输入新的值!还不知道为啥 */
const {measuresProject,measuresEmergency,measuresAdministration,measuresDeptName,measuresUserName,measuresUserPhone,presenceLocation} = res.data
const {
measuresProject,
measuresEmergency,
measuresAdministration,
measuresDeptName,
measuresUserName,
measuresUserPhone,
presenceLocation
} = res.data;
const formValue = {
measuresProject,
measuresEmergency,
......@@ -760,11 +776,11 @@ export default {
measuresUserName,
measuresUserPhone,
presenceLocation
}
};
this.form = {
...this.form,
...formValue
}
};
})
.catch(() => {
this.$toast.clear();
......
......@@ -43,18 +43,18 @@
placeholder="请输入"
:rules="[{ required: true, message: '任务名称不能为空' }]"
/>
<div style="display: flex;">
<van-field
required
readonly
name="projectName"
:value="form.projectName"
label="关联项目"
placeholder="请选择"
@click="show = true"
:rules="[{ required: true, message: '关联项目不能为空' }]"
/>
required
readonly
name="projectName"
:value="form.projectName"
label="关联项目"
placeholder="请选择"
@click="show = true"
:rules="[{ required: true, message: '关联项目不能为空' }]"
/>
<van-button
style="color: #cccc;background-color: #f0f1f5;"
icon="plus"
......@@ -74,15 +74,15 @@
</van-popup> -->
<div style="display: flex;">
<van-field
required
readonly
name="buildingNames"
:value="form.buildingNames"
label="评估楼栋"
placeholder="请输入"
@click="getRiskList()"
:rules="[{ required: true, message: '评估楼栋不能为空' }]"
/>
required
readonly
name="buildingNames"
:value="form.buildingNames"
label="评估楼栋"
placeholder="请输入"
@click="getRiskList()"
:rules="[{ required: true, message: '评估楼栋不能为空' }]"
/>
<van-button
style="color: #cccc;background-color: #f0f1f5;"
icon="plus"
......@@ -297,19 +297,19 @@
>取消</van-button
>
</div>
<CreateComponent
v-if="createComponentData.visible"
@close="createComponentData.close"
@confirm="createComponentData.confirm"
:type="createComponentData.type"
:projectId="createComponentData.projectId"
/>
<CreateComponent
v-if="createComponentData.visible"
@close="createComponentData.close"
@confirm="createComponentData.confirm"
:type="createComponentData.type"
:projectId="createComponentData.projectId"
/>
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import CreateComponent from './addProject.vue'
import CreateComponent from "./addProject.vue";
import selectDept from "@/components/selectDept/index.vue";
import selectPeople from "@/views/riskProject/add/projectList.vue";
import { timestampToTime, generateId } from "@/utils/format";
......@@ -318,7 +318,7 @@ import {
getLocalUserInfo,
setLocalUserInfo
} from "@/utils/userInfo";
import { getFun, postFun,putFun } from "@/service/table.js";
import { getFun, postFun, putFun } from "@/service/table.js";
export default {
name: "risk-add",
......@@ -335,11 +335,11 @@ export default {
},
data() {
return {
createComponentData:{
visible:false,
type:'',
close:this.projectComponentClose,
confirm:this.projectComponentConfirm
createComponentData: {
visible: false,
type: "",
close: this.projectComponentClose,
confirm: this.projectComponentConfirm
},
loadingStatus: false,
loadingText: "提交...",
......@@ -402,16 +402,16 @@ export default {
};
},
created() {
if(this.$route.query.id){
this.text = '编辑'
this.getDetail(this.$route.query.id)
}else{
if (this.$route.query.id) {
this.text = "编辑";
this.getDetail(this.$route.query.id);
} else {
var userInfo = getUserInfo();
this.form.userId = userInfo.userId;
this.form.userName = userInfo.nickName;
this.form.deptId = userInfo.dept.deptId;
this.form.deptName = userInfo.dept.deptName;
this.form.createDeptName = userInfo.dept.deptName
this.form.createDeptName = userInfo.dept.deptName;
}
getFun(`/risk/plan/project/list`).then(res => {
this.columnsSource = res.data;
......@@ -419,13 +419,13 @@ export default {
},
methods: {
/* 创建项目 */
createProject(){
createProject() {
this.createComponentData.visible = true;
this.createComponentData.type = 'project'
this.createComponentData.type = "project";
},
/* 创建 */
createBuilding(){
if (!this.form.projectId) {
createBuilding() {
if (!this.form.projectId) {
this.$toast({
title: "提示",
message: "请选择关联项目!"
......@@ -433,19 +433,19 @@ export default {
return false;
}
this.createComponentData.visible = true;
this.createComponentData.type = 'building'
this.createComponentData.projectId = this.form.projectId
this.createComponentData.type = "building";
this.createComponentData.projectId = this.form.projectId;
},
projectComponentClose(){
projectComponentClose() {
this.createComponentData.visible = false;
this.createComponentData.type = ''
this.createComponentData.type = "";
},
projectComponentConfirm(data){
projectComponentConfirm(data) {
// this.createComponentData.visible = false;
// this.createComponentData.type = '';
},
getDetail(id){
this.$toast.loading({
getDetail(id) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
......@@ -453,12 +453,12 @@ export default {
});
getFun(`/risk/plan/details/${id}`)
.then(res => {
this.$toast.clear()
this.$toast.clear();
this.form = res.data.detailsDto;
this.form.userName= this.form.createUserName
this.form.userName = this.form.createUserName;
})
.catch(() => {
this.$toast.clear()
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
......@@ -609,14 +609,14 @@ export default {
// });
this.loadingStatus = true;
let url = "/risk/plan";
const fetch = ()=>{
if(this.$route.query.id){
return putFun(url,this.form)
}else{
delete this.form.createDeptName
return postFun(url,this.form)
}
const fetch = () => {
if (this.$route.query.id) {
return putFun(url, this.form);
} else {
delete this.form.createDeptName;
return postFun(url, this.form);
}
};
fetch()
.then(res => {
this.$toast.clear();
......
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