Commit a31deac3 authored by p-wanping.song's avatar p-wanping.song

0906问题列表修复

parent 559a46c5
...@@ -31,6 +31,17 @@ ...@@ -31,6 +31,17 @@
<div>{{ form.signTime }}</div> <div>{{ form.signTime }}</div>
</template> --> </template> -->
</van-field> </van-field>
<van-field
required
readonly
name="projectName"
:value="form.projectName"
label="关联项目"
placeholder="请选择"
@click="showProject = true"
:rules="[{ required: true, message: '关联项目不能为空' }]"
>
</van-field>
<van-field <van-field
required required
name="remark" name="remark"
...@@ -62,6 +73,13 @@ ...@@ -62,6 +73,13 @@
> >
</div> </div>
</van-form> </van-form>
<van-popup
v-model="showProject"
position="bottom"
:style="{ height: '100%' }"
>
<selectPeople @onClose="onClose" @onSave="onSave"></selectPeople>
</van-popup>
</div> </div>
</template> </template>
...@@ -69,12 +87,15 @@ ...@@ -69,12 +87,15 @@
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import { getUserInfo } from "@/utils/userInfo"; import { getUserInfo } from "@/utils/userInfo";
import { getFun, postFun } from "@/service/table.js"; import { getFun, postFun } from "@/service/table.js";
import selectPeople from "@/views/riskProject/add/projectList.vue";
export default { export default {
components: { components: {
LHeader, LHeader,
selectPeople,
}, },
data() { data() {
return { return {
showProject: false,
timer: "", timer: "",
userName: "用户名", userName: "用户名",
form: { form: {
...@@ -82,6 +103,8 @@ export default { ...@@ -82,6 +103,8 @@ export default {
file: [], file: [],
remark: "", remark: "",
userId: "", userId: "",
projectName: "",
projectId: "",
}, },
}; };
}, },
...@@ -94,6 +117,15 @@ export default { ...@@ -94,6 +117,15 @@ export default {
}, },
methods: { methods: {
onClose() {
this.showProject = false;
},
onSave(val) {
this.onClose();
console.log(val);
this.form.projectId = val.id;
this.form.projectName = val.name;
},
toGetUserInfo() { toGetUserInfo() {
this.userName = getUserInfo().userName; this.userName = getUserInfo().userName;
this.form.userId = getUserInfo().userId; this.form.userId = getUserInfo().userId;
......
...@@ -115,15 +115,23 @@ ...@@ -115,15 +115,23 @@
v-show="form.pointType == '设备设施类'" v-show="form.pointType == '设备设施类'"
> >
<template #input> <template #input>
<span style="margin-right: 10px; color: red"></span> <van-radio-group
<van-switch
v-model="form.specialEquipment" v-model="form.specialEquipment"
size="20" direction="horizontal"
name="specialEquipment" >
/> <van-radio :name="true"></van-radio>
<span style="margin-left: 10px; color: green"></span> <van-radio :name="false"></van-radio>
</van-radio-group>
</template> </template>
</van-field> </van-field>
<van-field
v-if="form.specialEquipment == true"
clickable
name="pointType"
v-model="form.equipmentNumber"
label="特种设备的证书号码"
placeholder="请选择"
/>
<!-- 多选 --> <!-- 多选 -->
<van-field <van-field
v-model="form.safetyWarningSigns" v-model="form.safetyWarningSigns"
......
...@@ -117,15 +117,23 @@ ...@@ -117,15 +117,23 @@
v-show="form.pointType == '设备设施类'" v-show="form.pointType == '设备设施类'"
> >
<template #input> <template #input>
<span style="margin-right: 10px; color: red"></span> <van-radio-group
<van-switch
name="specialEquipment"
v-model="form.specialEquipment" v-model="form.specialEquipment"
size="20" direction="horizontal"
/> >
<span style="margin-left: 10px; color: green"></span> <van-radio :name="true"></van-radio>
<van-radio :name="false"></van-radio>
</van-radio-group>
</template> </template>
</van-field> </van-field>
<van-field
v-if="form.specialEquipment == true"
clickable
name="pointType"
v-model="form.equipmentNumber"
label="特种设备的证书号码"
placeholder="请选择"
/>
<!-- 多选 --> <!-- 多选 -->
<van-field <van-field
v-model="form.safetyWarningSigns" v-model="form.safetyWarningSigns"
......
<!-- 新建项目/新建楼宇--> <!-- 新建项目/新建楼宇-->
<template> <template>
<div class="project-component"> <div class="project-component">
<LHeader :text="initData[type].title" :customBack="pageDestory"></LHeader> <LHeader :text="initData[type].title" :customBack="pageDestory"></LHeader>
<van-form <van-form
...@@ -12,9 +10,7 @@ ...@@ -12,9 +10,7 @@
:show-error="false" :show-error="false"
validate-trigger="onSubmit" validate-trigger="onSubmit"
> >
<template v-for="item in initData[type].columns"> <template v-for="item in initData[type].columns">
<van-field <van-field
v-if="item.type === 'input'" v-if="item.type === 'input'"
:name="item.name" :name="item.name"
...@@ -30,18 +26,62 @@ ...@@ -30,18 +26,62 @@
:name="item.name" :name="item.name"
:label="item.label" :label="item.label"
:value="form[item.key]" :value="form[item.key]"
:key="item.name" :key="item.key"
readonly readonly
@click="choice.select(item)" @click="choice.select(item)"
v-bind="item._config" v-bind="item._config"
/> />
<van-field
v-if="item.type === 'radio'"
:label="item.label"
v-bind="item._config"
:key="item.key"
:name="item.name"
>
<template #input>
<van-radio-group v-model="form[item.key]" direction="horizontal">
<van-radio
v-for="option in item.options"
:key="option.name"
:name="option.name"
>{{ option.name }}</van-radio
>
</van-radio-group>
</template>
</van-field>
<van-field
v-if="item.type === 'checkbox'"
:label="item.label"
v-bind="item._config"
:key="item.key"
>
<template #input>
<template v-if="item.options.length == 1">
<van-checkbox v-model="form[item.key]" shape="square">
{{ item.options[0].name }}
</van-checkbox>
</template>
<van-checkbox-group
v-else
v-model="form[item.key]"
direction="horizontal"
>
<van-checkbox
v-for="option in item.options"
:key="option.name"
:name="option.name"
shape="square"
>
{{ option.name }}
</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</template> </template>
<!-- 选择层 --> <!-- 选择层 -->
<van-popup v-model="choice.visible" position="bottom"> <van-popup v-model="choice.visible" position="bottom">
<van-picker <van-picker
show-toolbar show-toolbar
value-key="name" value-key="name"
...@@ -49,11 +89,9 @@ ...@@ -49,11 +89,9 @@
@confirm="choice.confirm" @confirm="choice.confirm"
@cancel="choice.cancel" @cancel="choice.cancel"
/> />
</van-popup> </van-popup>
<div class="action-btns"> <div class="action-btns">
<van-button <van-button
class="confirm-btn" class="confirm-btn"
:loading="loadingStatus" :loading="loadingStatus"
...@@ -66,39 +104,42 @@ ...@@ -66,39 +104,42 @@
保存 保存
</van-button> </van-button>
<van-button class="cancel-btn" round block type="warning" @click="pageDestory"> <van-button
class="cancel-btn"
round
block
type="warning"
@click="pageDestory"
>
取消 取消
</van-button> </van-button>
</div> </div>
</van-form> </van-form>
<!-- 选择项目小组 --> <!-- 选择项目小组 -->
<van-popup <van-popup
v-model="dept.visible" v-model="dept.visible"
position="bottom" position="bottom"
:style="{ height: '100%' }" :style="{ height: '100%' }"
>
<div
class="van-picker__toolbar"
style="position: absolute; width: 100%; top: 0"
> >
<div <button type="button" class="van-picker__cancel" @click="dept.close">
class="van-picker__toolbar" 取消</button
style="position: absolute;width: 100%;top: 0;" ><button
type="button"
class="van-picker__confirm"
@click="dept.confirm"
> >
<button 确认
type="button" </button>
class="van-picker__cancel" </div>
@click="dept.close" <div style="display: flex; margin-top: 44px">
> <selectDept ref="selectDeptRef"></selectDept>
取消</button </div>
><button type="button" class="van-picker__confirm" @click="dept.confirm"> </van-popup>
确认
</button>
</div>
<div style="display:flex;margin-top: 44px;">
<selectDept ref="selectDeptRef"></selectDept>
</div>
</van-popup>
</div> </div>
</template> </template>
<script> <script>
...@@ -108,28 +149,28 @@ import selectDept from "@/components/selectDept/index.vue"; ...@@ -108,28 +149,28 @@ import selectDept from "@/components/selectDept/index.vue";
export default { export default {
components: { components: {
LHeader, LHeader,
selectDept, selectDept,
}, },
props: { props: {
type: { type: {
/* type:project,building */ /* type:project,building */
type: String, type: String,
default: "building" default: "building",
},
projectId: {
type: Number,
}, },
projectId:{
type:Number,
}
}, },
data() { data() {
return { return {
loadingStatus: false, loadingStatus: false,
loadingText: "保存中...", loadingText: "保存中...",
form: {}, form: {},
dept:{ dept: {
visible:false, visible: false,
select:this.deptSelect, select: this.deptSelect,
close:this.deptClose, close: this.deptClose,
confirm:this.deptConfirm confirm: this.deptConfirm,
}, },
choice: { choice: {
key: "", key: "",
...@@ -137,7 +178,7 @@ export default { ...@@ -137,7 +178,7 @@ export default {
columns: [], columns: [],
confirm: this.choiceConfirm, confirm: this.choiceConfirm,
select: this.choiceSelect, select: this.choiceSelect,
cancel: this.choiceCancal cancel: this.choiceCancal,
}, },
initData: { initData: {
project: { project: {
...@@ -154,10 +195,10 @@ export default { ...@@ -154,10 +195,10 @@ export default {
rules: [ rules: [
{ {
required: true, required: true,
message: "项目名称不能为空" message: "项目名称不能为空",
} },
] ],
} },
}, },
{ {
label: "项目类型", label: "项目类型",
...@@ -165,14 +206,14 @@ export default { ...@@ -165,14 +206,14 @@ export default {
type: "select", type: "select",
options: [ options: [
{ {
name: "地产" name: "地产",
}, },
{ {
name: "土地" name: "土地",
}, },
{ {
name: "其他" name: "其他",
} },
], ],
_config: { _config: {
required: true, required: true,
...@@ -180,28 +221,27 @@ export default { ...@@ -180,28 +221,27 @@ export default {
rules: [ rules: [
{ {
required: true, required: true,
message: "项目类型不能为空" message: "项目类型不能为空",
} },
] ],
} },
}, },
{ {
label: "所属单位", label: "所属单位",
key: "deptName", key: "deptName",
type: "input", type: "input",
method:this.projectDeptEvent, method: this.projectDeptEvent,
_config: { _config: {
required: true, required: true,
readonly:true, readonly: true,
placeholder: "请输入所属单位", placeholder: "请输入所属单位",
rules: [ rules: [
{ {
required: true, required: true,
message: "所属单位不能为空" message: "所属单位不能为空",
} },
] ],
}, },
}, },
{ {
label: "所在城市", label: "所在城市",
...@@ -213,10 +253,10 @@ export default { ...@@ -213,10 +253,10 @@ export default {
rules: [ rules: [
{ {
required: true, required: true,
message: "所在城市不能为空" message: "所在城市不能为空",
} },
] ],
} },
}, },
{ {
label: "详细地址", label: "详细地址",
...@@ -228,12 +268,38 @@ export default { ...@@ -228,12 +268,38 @@ export default {
rules: [ rules: [
{ {
required: true, required: true,
message: "详细地址不能为空" message: "详细地址不能为空",
} },
] ],
} },
} },
] {
label: "经营状态",
key: "businessStatus",
type: "radio",
options: [{ name: "自营" }, { name: "租赁" }],
_config: {
required: true,
placeholder: "请选择经营状态",
rules: [
{
required: true,
message: "请选择经营状态",
},
],
},
},
{
label: "是否为物业",
key: "propertyManagement",
type: "checkbox",
defaultValue: false,
options: [{ name: "物业" }],
_config: {
placeholder: "请选择经营状态",
},
},
],
}, },
building: { building: {
title: "新建楼宇", title: "新建楼宇",
...@@ -246,21 +312,19 @@ export default { ...@@ -246,21 +312,19 @@ export default {
_config: { _config: {
rules: [{ required: true, message: "楼宇名称不能为空" }], rules: [{ required: true, message: "楼宇名称不能为空" }],
placeholder: "请输入楼宇名称", placeholder: "请输入楼宇名称",
required: true required: true,
} },
}, },
{ {
label: "资产类型", label: "资产类型",
key: "type", key: "type",
type: "select", type: "select",
options: [ options: [{ name: "地产" }, { name: "土地" }, { name: "其他" }],
{ name: "地产" },{ name: "土地" },{ name: "其他" },
],
_config: { _config: {
rules: [{ required: true, message: "资产类型不能为空" }], rules: [{ required: true, message: "资产类型不能为空" }],
placeholder: "请选择资产类型", placeholder: "请选择资产类型",
required: true required: true,
} },
}, },
{ {
label: "地上楼层几层", label: "地上楼层几层",
...@@ -270,8 +334,8 @@ export default { ...@@ -270,8 +334,8 @@ export default {
type: "number", type: "number",
rules: [{ required: true, message: "地上楼层几层不能为空" }], rules: [{ required: true, message: "地上楼层几层不能为空" }],
placeholder: "请输入地上楼层几层", placeholder: "请输入地上楼层几层",
required: true required: true,
} },
}, },
{ {
label: "地下楼层几层", label: "地下楼层几层",
...@@ -281,21 +345,19 @@ export default { ...@@ -281,21 +345,19 @@ export default {
type: "number", type: "number",
rules: [{ required: true, message: "地下楼层几层不能为空" }], rules: [{ required: true, message: "地下楼层几层不能为空" }],
placeholder: "请输入地下楼层几层", placeholder: "请输入地下楼层几层",
required: true required: true,
} },
}, },
{ {
label: "用途", label: "用途",
key: "useto", key: "useto",
type: "select", type: "select",
options: [ options: [{ name: "地产" }, { name: "土地" }, { name: "其他" }],
{ name: "地产" },{ name: "土地" },{ name: "其他" },
],
_config: { _config: {
rules: [{ required: true, message: "用途不能为空" }], rules: [{ required: true, message: "用途不能为空" }],
placeholder: "请选择用途", placeholder: "请选择用途",
required: true required: true,
} },
}, },
{ {
label: "所在城市", label: "所在城市",
...@@ -304,8 +366,8 @@ export default { ...@@ -304,8 +366,8 @@ export default {
_config: { _config: {
rules: [{ required: true, message: "所在城市不能为空" }], rules: [{ required: true, message: "所在城市不能为空" }],
placeholder: "请输入所在城市", placeholder: "请输入所在城市",
required: true required: true,
} },
}, },
{ {
label: "详细地址", label: "详细地址",
...@@ -314,36 +376,53 @@ export default { ...@@ -314,36 +376,53 @@ export default {
_config: { _config: {
rules: [{ required: true, message: "详细地址不能为空" }], rules: [{ required: true, message: "详细地址不能为空" }],
placeholder: "请输入详细地址", placeholder: "请输入详细地址",
required: true required: true,
} },
} },
] ],
} },
} },
}; };
}, },
watch: {
type: {
handler(newVal, oldVal) {
console.log(111);
this.initData[newVal].columns.forEach((val) => {
if (val.hasOwnProperty("defaultValue")) {
// this.form[val.key] = val.defaultValue;
this.$set(this.form, val.key, val.defaultValue);
}
});
},
immediate: true,
},
},
methods: { methods: {
/* 作为载体处理方法 */ /* 作为载体处理方法 */
fieldClick(item){ fieldClick(item) {
if(item.method){item.method()} if (item.method) {
item.method();
}
}, },
deptClose(){ deptClose() {
this.dept.visible = false; this.dept.visible = false;
}, },
deptConfirm(){ deptConfirm() {
const selectDeptRef = this.$refs.selectDeptRef; const selectDeptRef = this.$refs.selectDeptRef;
this.form.deptId = selectDeptRef.result; this.form.deptId = selectDeptRef.result;
this.form.deptName = selectDeptRef.resultName; this.form.deptName = selectDeptRef.resultName;
this.dept.close() this.dept.close();
}, },
choiceConfirm(val) { choiceConfirm(val) {
this.form[this.choice.key] = val.name; this.form[this.choice.key] = val.name;
this.choice.cancel(); this.choice.cancel();
}, },
projectDeptEvent(){ projectDeptEvent() {
this.dept.visible = true this.dept.visible = true;
}, },
choiceCancal() { choiceCancal() {
console.log(this.form);
this.choice.visible = false; this.choice.visible = false;
this.choice.key = ""; this.choice.key = "";
this.choice.columns = []; this.choice.columns = [];
...@@ -354,40 +433,40 @@ export default { ...@@ -354,40 +433,40 @@ export default {
this.choice.columns = item.options; this.choice.columns = item.options;
}, },
/* 点击返回、点击取消 */ /* 点击返回、点击取消 */
pageDestory(){ pageDestory() {
this.choiceCancal() this.choiceCancal();
this.$emit('close') this.$emit("close");
}, },
onSubmit() { onSubmit() {
this.loadingStatus = true; this.loadingStatus = true;
if(this.type==='building'){ if (this.type === "building") {
if(!this.projectId){ if (!this.projectId) {
this.$toast("保存失败,未获取到项目Id"); this.$toast("保存失败,未获取到项目Id");
return; return;
} }
this.form.projectId = this.projectId; this.form.projectId = this.projectId;
} }
postFun(this.initData[this.type].fetchUrl,this.form) postFun(this.initData[this.type].fetchUrl, this.form)
.then((res) => { .then((res) => {
if(this.type==='project'){ if (this.type === "project") {
this.form.projectId =res.data this.form.projectId = res.data;
} }
setTimeout(() => { setTimeout(() => {
this.loadingStatus = false; this.loadingStatus = false;
this.$toast("保存成功"); this.$toast("保存成功");
this.$emit("confirm",this.form) this.$emit("confirm", this.form);
}, 2000); }, 2000);
}).catch(()=>{
this.loadingStatus = false;
this.$toast("保存失败");
}) })
} .catch(() => {
} this.loadingStatus = false;
this.$toast("保存失败");
});
},
},
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.project-component { .project-component {
position: fixed; position: fixed;
width: 100vw; width: 100vw;
...@@ -396,16 +475,16 @@ export default { ...@@ -396,16 +475,16 @@ export default {
left: 0; left: 0;
z-index: 100; z-index: 100;
background: #fff; background: #fff;
.van-form{ .van-form {
height: calc(100vh - 1.6rem); height: calc(100vh - 1.6rem);
overflow: auto; overflow: auto;
}
.action-btns {
margin-top: 1rem;
padding: 0 0.5rem;
.cancel-btn {
margin-top: 0.3rem;
} }
} .action-btns {
margin-top: 1rem;
padding: 0 0.5rem;
.cancel-btn {
margin-top: 0.3rem;
}
}
} }
</style> </style>
...@@ -46,16 +46,23 @@ ...@@ -46,16 +46,23 @@
v-show="form.pointType == '设备设施类'" v-show="form.pointType == '设备设施类'"
> >
<template #input> <template #input>
<span style="margin-right: 10px; color: red"></span> <van-radio-group
<van-switch
disabled
v-model="form.specialEquipment" v-model="form.specialEquipment"
size="20" direction="horizontal"
name="specialEquipment" >
/> <van-radio :name="true"></van-radio>
<span style="margin-left: 10px; color: green"></span> <van-radio :name="false"></van-radio>
</van-radio-group>
</template> </template>
</van-field> </van-field>
<van-field
v-if="form.specialEquipment == true"
clickable
name="pointType"
v-model="form.equipmentNumber"
label="特种设备的证书号码"
placeholder="请选择"
/>
<!-- 多选 --> <!-- 多选 -->
<van-field <van-field
v-model="form.safetyWarningSigns" v-model="form.safetyWarningSigns"
......
...@@ -7,12 +7,17 @@ ...@@ -7,12 +7,17 @@
validate-trigger="onSubmit" validate-trigger="onSubmit"
> >
<div <div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" style="
height: 1rem;
font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';
font-weight: 700;
line-height: 1rem;
"
> >
<img <img
src="@/assets/accidentIcon/bookmark.svg" src="@/assets/accidentIcon/bookmark.svg"
alt="" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" style="position: relative; top: 32%; transform: translateY(-50%)"
/> />
风险信息 风险信息
</div> </div>
...@@ -52,7 +57,7 @@ ...@@ -52,7 +57,7 @@
:rules="[{ required: true, message: '所属楼层不能为空' }]" :rules="[{ required: true, message: '所属楼层不能为空' }]"
/> />
<div style="display: flex;"> <div style="display: flex">
<van-field <van-field
readonly readonly
required required
...@@ -87,16 +92,27 @@ ...@@ -87,16 +92,27 @@
/> />
<van-field <van-field
required required
name="specialEquipment"
label="是否为特种设备" label="是否为特种设备"
v-show="form.pointType == '设备设施类'" v-show="form.pointType == '设备设施类'"
> >
<template #input> <template #input>
<span style="margin-right: 10px;color: red;"></span> <van-radio-group
<van-switch disabled v-model="form.specialEquipment" size="20" /> v-model="form.specialEquipment"
<span style="margin-left: 10px;color: green;"></span> direction="horizontal"
>
<van-radio :name="true"></van-radio>
<van-radio :name="false"></van-radio>
</van-radio-group>
</template> </template>
</van-field> </van-field>
<van-field
v-if="form.specialEquipment == true"
clickable
name="pointType"
v-model="form.equipmentNumber"
label="特种设备的证书号码"
placeholder="请选择"
/>
<!-- 多选 --> <!-- 多选 -->
<van-field <van-field
v-model="form.safetyWarningSigns" v-model="form.safetyWarningSigns"
...@@ -148,12 +164,17 @@ ...@@ -148,12 +164,17 @@
/> />
<div <div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" style="
height: 1rem;
font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';
font-weight: 700;
line-height: 1rem;
"
> >
<img <img
src="@/assets/accidentIcon/bookmark.svg" src="@/assets/accidentIcon/bookmark.svg"
alt="" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" style="position: relative; top: 32%; transform: translateY(-50%)"
/> />
风险图片 风险图片
</div> </div>
...@@ -171,14 +192,14 @@ ...@@ -171,14 +192,14 @@
<!-- 11111111111 --> <!-- 11111111111 -->
<div <div
style=" style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
" "
> >
<img <img
src="@/assets/upload/pic.png" src="@/assets/upload/pic.png"
...@@ -192,12 +213,17 @@ ...@@ -192,12 +213,17 @@
</template> </template>
</van-field> </van-field>
<div <div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" style="
height: 1rem;
font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';
font-weight: 700;
line-height: 1rem;
"
> >
<img <img
src="@/assets/accidentIcon/bookmark.svg" src="@/assets/accidentIcon/bookmark.svg"
alt="" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" style="position: relative; top: 32%; transform: translateY(-50%)"
/> />
应采取的管控措施 应采取的管控措施
</div> </div>
...@@ -212,7 +238,7 @@ ...@@ -212,7 +238,7 @@
rows="3" rows="3"
autosize autosize
placeholder="请输入" placeholder="请输入"
style="padding-left: 0;padding-top: 0;" style="padding-left: 0; padding-top: 0"
/> />
</template> </template>
</van-field> </van-field>
...@@ -230,14 +256,14 @@ ...@@ -230,14 +256,14 @@
<template slot="default"> <template slot="default">
<div <div
style=" style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
" "
> >
<img <img
src="@/assets/upload/file.png" src="@/assets/upload/file.png"
...@@ -262,7 +288,7 @@ ...@@ -262,7 +288,7 @@
rows="3" rows="3"
autosize autosize
placeholder="请输入" placeholder="请输入"
style="padding-left: 0;padding-top: 0;" style="padding-left: 0; padding-top: 0"
/> />
</template> </template>
</van-field> </van-field>
...@@ -280,14 +306,14 @@ ...@@ -280,14 +306,14 @@
<template slot="default"> <template slot="default">
<div <div
style=" style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
" "
> >
<img <img
src="@/assets/upload/file.png" src="@/assets/upload/file.png"
...@@ -311,7 +337,7 @@ ...@@ -311,7 +337,7 @@
rows="3" rows="3"
autosize autosize
placeholder="请输入" placeholder="请输入"
style="padding-left: 0;padding-top: 0;" style="padding-left: 0; padding-top: 0"
/> />
</template> </template>
</van-field> </van-field>
...@@ -330,13 +356,13 @@ ...@@ -330,13 +356,13 @@
<!-- 11111111111 --> <!-- 11111111111 -->
<div <div
style=" style="
width: 2.13333rem; width: 2.13333rem;
height: 2.13333rem; height: 2.13333rem;
background: #f7f8fa; background: #f7f8fa;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
" "
> >
<img <img
...@@ -384,20 +410,25 @@ ...@@ -384,20 +410,25 @@
/> />
<div <div
style="height: 1rem;font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;line-height: 1rem;" style="
height: 1rem;
font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';
font-weight: 700;
line-height: 1rem;
"
> >
<img <img
src="@/assets/accidentIcon/bookmark.svg" src="@/assets/accidentIcon/bookmark.svg"
alt="" alt=""
style="position: relative;top: 32%;transform: translateY(-50%);" style="position: relative; top: 32%; transform: translateY(-50%)"
/> />
重大危险源管理 重大危险源管理
</div> </div>
<van-field name="majorHazardSource" label="是否为重大危险源"> <van-field name="majorHazardSource" label="是否为重大危险源">
<template #input> <template #input>
<span style="margin-right: 10px;color: red;"></span> <span style="margin-right: 10px; color: red"></span>
<van-switch disabled v-model="form.majorHazardSource" size="20" /> <van-switch disabled v-model="form.majorHazardSource" size="20" />
<span style="margin-left: 10px;color: green;"></span> <span style="margin-left: 10px; color: green"></span>
</template> </template>
</van-field> </van-field>
<van-field <van-field
...@@ -422,7 +453,7 @@ ...@@ -422,7 +453,7 @@
rows="3" rows="3"
autosize autosize
placeholder="请输入" placeholder="请输入"
style="padding-left: 0;padding-top: 0;" style="padding-left: 0; padding-top: 0"
/> />
</template> </template>
</van-field> </van-field>
...@@ -450,7 +481,7 @@ export default { ...@@ -450,7 +481,7 @@ export default {
activated() { activated() {
this.showSetRank = false; // 再次关闭弹出层 以防万一 this.showSetRank = false; // 再次关闭弹出层 以防万一
this.getList(); this.getList();
this.$bus.$on("riskLevelBus", res => { this.$bus.$on("riskLevelBus", (res) => {
this.showSetRank = false; // 再次关闭弹出层 以防万一 this.showSetRank = false; // 再次关闭弹出层 以防万一
console.log(Boolean(res)); console.log(Boolean(res));
if (res) { if (res) {
...@@ -488,7 +519,7 @@ export default { ...@@ -488,7 +519,7 @@ export default {
isTimely: 1, isTimely: 1,
active: 0, active: 0,
form: { form: {
specialEquipment: false specialEquipment: false,
}, },
projectId: "", // 所属工程 projectId: "", // 所属工程
projectName: "", // 所属工程 projectName: "", // 所属工程
...@@ -547,7 +578,7 @@ export default { ...@@ -547,7 +578,7 @@ export default {
severityScore: 0, severityScore: 0,
messageList: [], messageList: [],
inherentId: 0, inherentId: 0,
buildingIds: "" buildingIds: "",
}; };
}, },
created() { created() {
...@@ -581,40 +612,40 @@ export default { ...@@ -581,40 +612,40 @@ export default {
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0 duration: 0,
}); });
getFun(`/risk/plan/inherent/details/${this.inherentId}`) getFun(`/risk/plan/inherent/details/${this.inherentId}`)
.then(res => { .then((res) => {
this.form = res.data; this.form = res.data;
this.getFloor(); this.getFloor();
this.uploaderImg = (res.data.pictureFile || []).map(item => { this.uploaderImg = (res.data.pictureFile || []).map((item) => {
return { return {
...item, ...item,
url: item.filePath url: item.filePath,
}; };
}); });
this.measuresProjectFile = (res.data.measuresProjectFile || []).map( this.measuresProjectFile = (res.data.measuresProjectFile || []).map(
item => { (item) => {
return { return {
...item, ...item,
url: item.filePath url: item.filePath,
}; };
} }
); );
this.measuresAdministrationFile = ( this.measuresAdministrationFile = (
res.data.measuresAdministrationFile || [] res.data.measuresAdministrationFile || []
).map(item => { ).map((item) => {
return { return {
...item, ...item,
url: item.filePath url: item.filePath,
}; };
}); });
this.measuresEmergencyFile = ( this.measuresEmergencyFile = (
res.data.measuresEmergencyFile || [] res.data.measuresEmergencyFile || []
).map(item => { ).map((item) => {
return { return {
...item, ...item,
url: item.filePath url: item.filePath,
}; };
}); });
}) })
...@@ -637,7 +668,7 @@ export default { ...@@ -637,7 +668,7 @@ export default {
if (!this.form.measuresDeptId) { if (!this.form.measuresDeptId) {
this.$toast({ this.$toast({
title: "提示", title: "提示",
message: "请选择管控责任单位!" message: "请选择管控责任单位!",
}); });
return false; return false;
} }
...@@ -645,9 +676,9 @@ export default { ...@@ -645,9 +676,9 @@ export default {
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0 duration: 0,
}); });
getFun(`/risk/plan/user/list/${this.form.measuresDeptId}`).then(res => { getFun(`/risk/plan/user/list/${this.form.measuresDeptId}`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.columnsTrouble = res.data; this.columnsTrouble = res.data;
// 对数据进行赋值 // 对数据进行赋值
...@@ -670,7 +701,7 @@ export default { ...@@ -670,7 +701,7 @@ export default {
getFun( getFun(
`/risk/plan/dict/data/list?dictType=risk_plan_${dataName.toLowerCase()}` `/risk/plan/dict/data/list?dictType=risk_plan_${dataName.toLowerCase()}`
) )
.then(res => { .then((res) => {
if (isSinge) { if (isSinge) {
this.columnsData = res.data; this.columnsData = res.data;
this.showSelect = true; this.showSelect = true;
...@@ -692,7 +723,7 @@ export default { ...@@ -692,7 +723,7 @@ export default {
this.showCheckSelect = false; this.showCheckSelect = false;
}, },
renameKeyInTree(data, oldKey, newKey) { renameKeyInTree(data, oldKey, newKey) {
let arr = data.map(item => { let arr = data.map((item) => {
const newItem = { ...item }; const newItem = { ...item };
if (item.hasOwnProperty(oldKey)) { if (item.hasOwnProperty(oldKey)) {
...@@ -714,7 +745,7 @@ export default { ...@@ -714,7 +745,7 @@ export default {
}, },
getFloor() { getFloor() {
getFun(`/risk/plan/floor/list/${this.form.buildingId}`) getFun(`/risk/plan/floor/list/${this.form.buildingId}`)
.then(res => { .then((res) => {
// this.$toast.clear(); // this.$toast.clear();
// this.showSource = true; // this.showSource = true;
...@@ -734,11 +765,11 @@ export default { ...@@ -734,11 +765,11 @@ export default {
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0 duration: 0,
}); });
this.userPrefix = name; this.userPrefix = name;
getFun(`/risk/plan/room/list/${this.form.floorId}`) getFun(`/risk/plan/room/list/${this.form.floorId}`)
.then(res => { .then((res) => {
this.$toast.clear(); this.$toast.clear();
this.showSource = true; this.showSource = true;
this.columnsSource = res.data; this.columnsSource = res.data;
...@@ -757,14 +788,14 @@ export default { ...@@ -757,14 +788,14 @@ export default {
//风险模型配置 //风险模型配置
getGradeList(type) { getGradeList(type) {
// possibility 可能性 severity 严重性 // possibility 可能性 severity 严重性
getFun(`/risk/plan/matrix/${type}/list`).then(res => { getFun(`/risk/plan/matrix/${type}/list`).then((res) => {
let arr = []; let arr = [];
res.data.forEach(item => { res.data.forEach((item) => {
arr.push({ arr.push({
text: item.title, text: item.title,
type: item.type, type: item.type,
sort: item.sort, sort: item.sort,
score: item.score score: item.score,
}); });
}); });
if (type === "possibility") { if (type === "possibility") {
...@@ -798,9 +829,9 @@ export default { ...@@ -798,9 +829,9 @@ export default {
name: "resultPage", name: "resultPage",
params: { params: {
score: this.severityScore * this.possibleScore, score: this.severityScore * this.possibleScore,
possibleValue:this.possibleValue, possibleValue: this.possibleValue,
severityValue:this.severityValue, severityValue: this.severityValue,
} },
}); });
}, },
performTasks() { performTasks() {
...@@ -825,7 +856,7 @@ export default { ...@@ -825,7 +856,7 @@ export default {
jsonToFormData(config) { jsonToFormData(config) {
const formData = new FormData(); const formData = new FormData();
//循环传入的值转换formData //循环传入的值转换formData
Object.keys(config).forEach(key => { Object.keys(config).forEach((key) => {
formData.append(key, config[key]); formData.append(key, config[key]);
}); });
return formData; return formData;
...@@ -834,28 +865,28 @@ export default { ...@@ -834,28 +865,28 @@ export default {
// console.log('%c [ values ]-592', 'font-size:13px; background:pink; color:#bf2c9f;', values) // console.log('%c [ values ]-592', 'font-size:13px; background:pink; color:#bf2c9f;', values)
var formDataJson = this.jsonToFormData(this.form); var formDataJson = this.jsonToFormData(this.form);
let url = "/risk/plan/inherent"; let url = "/risk/plan/inherent";
values.hdPicture1.forEach(item => { values.hdPicture1.forEach((item) => {
if (item.file) { if (item.file) {
formDataJson.append("pictureFile[]", item.file); formDataJson.append("pictureFile[]", item.file);
} else { } else {
formDataJson.append("pictureFile[]", item.fileId); formDataJson.append("pictureFile[]", item.fileId);
} }
}); });
values["measuresProjectFile[]"].forEach(item => { values["measuresProjectFile[]"].forEach((item) => {
if (item.file) { if (item.file) {
formDataJson.append("measuresProjectFile[]", item.file); formDataJson.append("measuresProjectFile[]", item.file);
} else { } else {
formDataJson.append("measuresProjectFile[]", item.fileId); formDataJson.append("measuresProjectFile[]", item.fileId);
} }
}); });
values["measuresEmergencyFile[]"].forEach(item => { values["measuresEmergencyFile[]"].forEach((item) => {
if (item.file) { if (item.file) {
formDataJson.append("measuresEmergencyFile[]", item.file); formDataJson.append("measuresEmergencyFile[]", item.file);
} else { } else {
formDataJson.append("measuresEmergencyFile[]", item.fileId); formDataJson.append("measuresEmergencyFile[]", item.fileId);
} }
}); });
values["measuresAdministrationFile[]"].forEach(item => { values["measuresAdministrationFile[]"].forEach((item) => {
if (item.file) { if (item.file) {
formDataJson.append("measuresAdministrationFile[]", item.file); formDataJson.append("measuresAdministrationFile[]", item.file);
} else { } else {
...@@ -863,11 +894,11 @@ export default { ...@@ -863,11 +894,11 @@ export default {
} }
}); });
postFun(url, formDataJson) postFun(url, formDataJson)
.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);
}) })
...@@ -900,7 +931,7 @@ export default { ...@@ -900,7 +931,7 @@ export default {
this.trouble = ""; this.trouble = "";
// 请求风险源 // 请求风险源
postHdSource(`/riskMain/showSourceName?factorType=${this.factor}`).then( postHdSource(`/riskMain/showSourceName?factorType=${this.factor}`).then(
res => { (res) => {
this.columnsSource = res.data; this.columnsSource = res.data;
} }
); );
...@@ -923,7 +954,7 @@ export default { ...@@ -923,7 +954,7 @@ export default {
if (this.setRank == "矩阵式定级") { if (this.setRank == "矩阵式定级") {
this.showSetRank = false; this.showSetRank = false;
this.$router.push({ this.$router.push({
name: "matrix-grad" name: "matrix-grad",
}); });
} }
}, },
...@@ -955,7 +986,7 @@ export default { ...@@ -955,7 +986,7 @@ export default {
// 请求主责人员 // 请求主责人员
let formdata = new FormData(); let formdata = new FormData();
formdata.append("organizationId", this.mainDutyDeptId); formdata.append("organizationId", this.mainDutyDeptId);
postHdPeople(`/riskMain/getUserList`, formdata).then(res => { postHdPeople(`/riskMain/getUserList`, formdata).then((res) => {
this.columnsMainDutyPeopLe = res.data; this.columnsMainDutyPeopLe = res.data;
}); });
}, },
...@@ -971,8 +1002,8 @@ export default { ...@@ -971,8 +1002,8 @@ export default {
name: "riskView", name: "riskView",
params: { params: {
floorId: this.form.floorId, floorId: this.form.floorId,
isView: false isView: false,
} },
}); });
}, },
...@@ -992,9 +1023,9 @@ export default { ...@@ -992,9 +1023,9 @@ export default {
this.projectDirector = e[0].loginName; this.projectDirector = e[0].loginName;
this.projectDirectorName = e[0].userName; this.projectDirectorName = e[0].userName;
this.show = false; this.show = false;
} },
}, },
watch: {} watch: {},
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
...@@ -9,10 +9,10 @@ module.exports = { ...@@ -9,10 +9,10 @@ module.exports = {
proxy: { proxy: {
//配置跨域 //配置跨域
"/app-api": { "/app-api": {
// target: "http://192.168.4.232:8080/", //这里是后台的地址 target: "http://192.168.4.232:8080/", //这里是后台的地址
// target: "http://192.168.10.137:8080/", //这里是后台的地址 // target: "http://192.168.10.137:8080/", //这里是后台的地址
// target: 'http://192.168.15.124:8080/', //这里是杨帆的地址 // target: 'http://192.168.15.124:8080/', //这里是杨帆的地址
target: "http://192.168.10.137:8080/", //这里是昊哥的地址 // target: "http://192.168.10.137:8080/", //这里是周昊的地址
// target: "http://192.168.15.230:8080/", //这里是晓静的地址 // target: "http://192.168.15.230:8080/", //这里是晓静的地址
// target: 'http://localhost:8081/', //这里是后台的地址 // target: 'http://localhost:8081/', //这里是后台的地址
ws: true, ws: true,
......
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