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

业态添加自营

parent a31deac3
......@@ -122,7 +122,6 @@ export default {
},
onSave(val) {
this.onClose();
console.log(val);
this.form.projectId = val.id;
this.form.projectName = val.name;
},
......@@ -175,11 +174,16 @@ export default {
formData.append("userId", this.form.userId);
formData.append("type", type);
formData.append("remark", this.form.remark);
formData.append("projectId", this.form.projectId);
postFun("/risk/plan/sign", formData).then((res) => {
if (res.code == 200) {
if (res.code == 200 && res.data) {
this.$toast.success(type ? "签到成功" : "签退成功");
this.form.file = [];
this.form.remark = "";
this.form.projectId = "";
this.form.projectName = "";
} else {
this.$toast.fail(type ? "签到失败" : "签退失败");
}
});
});
......
......@@ -292,11 +292,20 @@ export default {
{
label: "是否为物业",
key: "propertyManagement",
type: "checkbox",
defaultValue: false,
options: [{ name: "物业" }],
type: "radio",
options: [
{ name: "", value: 1 },
{ name: "", value: 0 },
],
_config: {
placeholder: "请选择经营状态",
required: true,
placeholder: "请选择是否为物业",
rules: [
{
required: true,
message: "请选择是否为物业",
},
],
},
},
],
......
......@@ -8,12 +8,17 @@
validate-trigger="onSubmit"
>
<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
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
style="position: relative; top: 32%; transform: translateY(-50%)"
/>
服务项目信息
</div>
......@@ -44,7 +49,7 @@
:rules="[{ required: true, message: '任务名称不能为空' }]"
/>
<div style="display: flex;">
<div style="display: flex">
<van-field
required
readonly
......@@ -56,7 +61,7 @@
:rules="[{ required: true, message: '关联项目不能为空' }]"
/>
<van-button
style="color: #cccc;background-color: #f0f1f5;"
style="color: #cccc; background-color: #f0f1f5"
icon="plus"
type="info"
native-type="button"
......@@ -64,13 +69,46 @@
/>
</div>
<van-field
required
name="projectBusiness"
v-model="form.projectBusiness"
label="业态"
placeholder="请输入"
:rules="[{ required: true, message: '业态不能为空' }]"
/>
required
name="projectBusiness"
v-model="form.projectBusiness"
label="业态"
placeholder="请选择业态"
:rules="[{ required: true, message: '业态不能为空' }]"
readonly
@click="selectBusiness"
/>
<van-field
required
name="businessStatus"
label="经营状态"
placeholder="请选择"
:rules="[{ required: true, message: '经营状态不能为空' }]"
>
<template #input>
<van-radio-group v-model="form.businessStatus" direction="horizontal">
<van-radio name="自营">自营</van-radio>
<van-radio name="租赁">租赁</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
required
name="propertyManagement"
label="是否为物业"
placeholder="请选择"
:rules="[{ required: true, message: '是否为物业不能为空' }]"
>
<template #input>
<van-radio-group
v-model="form.propertyManagement"
direction="horizontal"
>
<van-radio name="是"></van-radio>
<van-radio name="否"></van-radio>
</van-radio-group>
</template>
</van-field>
<!-- <van-popup v-model="showSource" position="bottom">
<van-picker
show-toolbar
......@@ -80,7 +118,7 @@
@cancel="showSource = false"
/>
</van-popup> -->
<div style="display: flex;">
<div style="display: flex">
<van-field
required
readonly
......@@ -92,7 +130,7 @@
:rules="[{ required: true, message: '评估楼栋不能为空' }]"
/>
<van-button
style="color: #cccc;background-color: #f0f1f5;"
style="color: #cccc; background-color: #f0f1f5"
icon="plus"
type="info"
native-type="button"
......@@ -100,12 +138,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
src="@/assets/accidentIcon/bookmark.svg"
alt=""
style="position: relative;top: 32%;transform: translateY(-50%);"
style="position: relative; top: 32%; transform: translateY(-50%)"
/>
任务组织与分配
</div>
......@@ -192,7 +235,15 @@
@cancel="showTrouble = false"
/>
</van-popup>
<van-popup v-model="business.show" position="bottom">
<van-picker
show-toolbar
value-key="dictLabel"
:columns="business.columns"
@confirm="business.toConfirm"
@cancel="business.show = false"
/>
</van-popup>
<van-popup v-model="show" position="bottom" :style="{ height: '100%' }">
<selectPeople @onClose="onClose" @onSave="onSave"></selectPeople>
</van-popup>
......@@ -204,7 +255,7 @@
>
<div
class="van-picker__toolbar"
style="position: absolute;width: 100%;top: 0;"
style="position: absolute; width: 100%; top: 0"
>
<button
type="button"
......@@ -220,16 +271,16 @@
确认
</button>
</div>
<div style="display:flex;margin-top: 44px;">
<div style="display: flex; margin-top: 44px">
<van-checkbox-group
v-model="riskList"
ref="checkboxGroup"
class="building-select"
style="width: 100%;font-size: 18px;"
style="width: 100%; font-size: 18px"
>
<van-checkbox
shape="square"
style="margin: 10px 0px;"
style="margin: 10px 0px"
v-for="item in riskModelList"
:key="item.id"
:name="item"
......@@ -237,7 +288,7 @@
>
</van-checkbox-group>
</div>
<div style="display: flex;justify-content: space-around;">
<div style="display: flex; justify-content: space-around">
<van-button native-type="button" type="primary" v-on:click="checkAll"
>全选</van-button
>
......@@ -255,7 +306,7 @@
>
<div
class="van-picker__toolbar"
style="position: absolute;width: 100%;top: 0;"
style="position: absolute; width: 100%; top: 0"
>
<button
type="button"
......@@ -272,7 +323,7 @@
确认
</button>
</div>
<div style="display:flex;margin-top: 44px;">
<div style="display: flex; margin-top: 44px">
<selectDept @changeDept="changeDept"></selectDept>
</div>
</van-popup>
......@@ -324,7 +375,7 @@ import { timestampToTime, generateId } from "@/utils/format";
import {
getUserInfo,
getLocalUserInfo,
setLocalUserInfo
setLocalUserInfo,
} from "@/utils/userInfo";
import { getFun, postFun, putFun } from "@/service/table.js";
......@@ -334,7 +385,7 @@ export default {
LHeader,
selectPeople,
selectDept,
CreateComponent
CreateComponent,
},
beforeRouteLeave(to, from, next) {
if (to.name != "matrix-grad") {
......@@ -343,11 +394,16 @@ export default {
},
data() {
return {
business: {
show: false,
columns: [],
toConfirm: this.businessConfirm,
},
createComponentData: {
visible: false,
type: "", //project||building
type: "", //project||building
close: this.projectComponentClose,
confirm: this.projectComponentConfirm
confirm: this.projectComponentConfirm,
},
loadingStatus: false,
loadingText: "提交...",
......@@ -356,7 +412,7 @@ export default {
id: "",
form: {
name: "",
projectBusiness:''
projectBusiness: "",
},
projectId: "", // 所属工程
projectName: "", // 所属工程
......@@ -407,7 +463,7 @@ export default {
urgent: "", //应急措施文字
urgentImg: [], //应急措施图片
returnCause: "", // 退回原因
isShowreturnCause: false
isShowreturnCause: false,
};
},
created() {
......@@ -422,11 +478,37 @@ export default {
this.form.deptName = userInfo.dept.deptName;
this.form.createDeptName = userInfo.dept.deptName;
}
getFun(`/risk/plan/project/list`).then(res => {
getFun(`/risk/plan/project/list`).then((res) => {
this.columnsSource = res.data;
});
},
methods: {
// 业态
businessConfirm(value) {
this.business.show = false;
this.form.projectBusiness = value.dictLabel;
},
selectBusiness() {
this.business.show = true;
if (this.business.columns.length) {
return;
}
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
getFun(`/risk/plan/dict/data/list?dictType=risk_project_business`)
.then((res) => {
this.$toast.clear();
this.business.columns = res.data;
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
/* 创建项目 */
createProject() {
this.createComponentData.visible = true;
......@@ -437,7 +519,7 @@ export default {
if (!this.form.projectId) {
this.$toast({
title: "提示",
message: "请选择关联项目!"
message: "请选择关联项目!",
});
return false;
}
......@@ -451,24 +533,24 @@ export default {
},
projectComponentConfirm(data) {
// 如果是关联项目添加对应的项目名称和项目id
if( this.createComponentData.type ==='project'){
this.form.projectName = data.name
this.form.projectId = data.projectId
this.form.projectBusiness = ''
this.form.buildingNames = ''
this.form.buildingIds = ''
if (this.createComponentData.type === "project") {
this.form.projectName = data.name;
this.form.projectId = data.projectId;
this.form.projectBusiness = "";
this.form.buildingNames = "";
this.form.buildingIds = "";
}
this.createComponentData.close()
this.createComponentData.close();
},
getDetail(id) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
duration: 0,
});
getFun(`/risk/plan/details/${id}`)
.then(res => {
.then((res) => {
this.$toast.clear();
this.form = res.data.detailsDto;
this.form.userName = this.form.createUserName;
......@@ -507,9 +589,9 @@ export default {
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
duration: 0,
});
getFun(`/risk/plan/user/list/${this.form.deptId}`).then(res => {
getFun(`/risk/plan/user/list/${this.form.deptId}`).then((res) => {
if (res.code == 200) {
this.columnsTrouble = res.data;
// 对数据进行赋值
......@@ -536,9 +618,9 @@ export default {
this.projectDept = true;
},
changeDept(id, name) {
if(id!=this.form.deptId){
this.form.leaderUserName = ''
this.form.workUserNames=''
if (id != this.form.deptId) {
this.form.leaderUserName = "";
this.form.workUserNames = "";
}
this.form.deptId = id;
this.form.deptName = name;
......@@ -552,9 +634,9 @@ export default {
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
duration: 0,
});
getFun(`/risk/plan/user/list/${this.form.deptId}`).then(res => {
getFun(`/risk/plan/user/list/${this.form.deptId}`).then((res) => {
if (res.code == 200) {
this.riskModelList = res.data;
// 对数据进行赋值
......@@ -569,7 +651,7 @@ export default {
if (!this.form.projectId) {
this.$toast({
title: "提示",
message: "请选择关联项目!"
message: "请选择关联项目!",
});
return false;
}
......@@ -578,9 +660,9 @@ export default {
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
duration: 0,
});
getFun(`/risk/plan/building/list/${this.form.projectId}`).then(res => {
getFun(`/risk/plan/building/list/${this.form.projectId}`).then((res) => {
if (res.code == 200) {
this.riskModelList = res.data;
// 对数据进行赋值
......@@ -593,7 +675,7 @@ export default {
},
filterField(value, arr) {
var arrs = [];
arr.forEach(item => {
arr.forEach((item) => {
arrs.push(item[value]);
});
return arrs;
......@@ -608,7 +690,7 @@ export default {
res;
this.$toast({
title: "提示",
message: "删除成功!"
message: "删除成功!",
});
} else {
console.log("删除失败");
......@@ -634,11 +716,11 @@ export default {
}
};
fetch()
.then(res => {
.then((res) => {
this.$toast.clear();
this.$toast.success({
message: "提交成功",
duration: 2000
duration: 2000,
});
this.loadingStatus = false;
history.go(-1);
......@@ -658,10 +740,10 @@ export default {
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
duration: 0,
});
getFormList("/riskMain/add")
.then(res => {
.then((res) => {
this.$toast.clear();
this.columnsProjectName = res.data.projectInformations;
this.columnsFactor = res.data.riskInventories;
......@@ -679,46 +761,46 @@ export default {
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
duration: 0,
});
postriskConiCause(`/riskMain/edit/${this.taskId}`)
.then(res => {
.then((res) => {
// 定级方式
this.urgentImg = (res.data.imgsysFiles2 || []).map(item => {
this.urgentImg = (res.data.imgsysFiles2 || []).map((item) => {
return {
...item,
url: item.filePath,
file: new File([], item["fileName"], {})
file: new File([], item["fileName"], {}),
};
});
this.administrationImg = (res.data.imgsysFiles1 || []).map(item => {
this.administrationImg = (res.data.imgsysFiles1 || []).map((item) => {
return {
...item,
url: item.filePath,
file: new File([], item["fileName"], {})
file: new File([], item["fileName"], {}),
};
});
this.technologyImg = (res.data.imgsysFiles0 || []).map(item => {
this.technologyImg = (res.data.imgsysFiles0 || []).map((item) => {
return {
...item,
url: item.filePath,
file: new File([], item["fileName"], {})
file: new File([], item["fileName"], {}),
};
});
this.setRankModeImg = (res.data.imgsysFiles3 || []).map(item => {
this.setRankModeImg = (res.data.imgsysFiles3 || []).map((item) => {
return {
...item,
url: item.filePath,
file: new File([], item["fileName"], {})
file: new File([], item["fileName"], {}),
};
});
// 请求人员列表
let formdata = new FormData();
formdata.append("organizationId", data.responsibilityDept);
postHdPeople(`/riskMain/getUserList`, formdata).then(res => {
postHdPeople(`/riskMain/getUserList`, formdata).then((res) => {
this.columnsMainDutyPeopLe = res.data;
this.mainDutyPeopLe = this.columnsMainDutyPeopLe.filter(item => {
this.mainDutyPeopLe = this.columnsMainDutyPeopLe.filter((item) => {
return item["userId"] == data.responsibilityMember;
})[0]["userName"];
});
......@@ -727,7 +809,7 @@ export default {
this.returnCause = res.data.reason;
//请求风险源
postHdSource(`/risk/plan/project/list`).then(res => {
postHdSource(`/risk/plan/project/list`).then((res) => {
this.columnsSource = res.data;
});
})
......@@ -745,7 +827,7 @@ export default {
this.projectId = value.id;
this.projectName = value.projectName;
this.showProjectName = false;
// this.projectBusiness
// this.projectBusiness
},
// 风险因素
onConFactor(value) {
......@@ -759,7 +841,7 @@ export default {
this.trouble = "";
// 请求风险源
postHdSource(`/riskMain/showSourceName?factorType=${this.factor}`).then(
res => {
(res) => {
this.columnsSource = res.data;
}
);
......@@ -772,7 +854,7 @@ export default {
}
this.form.projectId = value.id;
this.form.projectName = value.name;
this.form.projectBusiness = value.business
this.form.projectBusiness = value.business;
this.showSource = false;
},
// 项目负责人
......@@ -793,7 +875,7 @@ export default {
if (this.setRank == "矩阵式定级") {
this.showSetRank = false;
this.$router.push({
name: "matrix-grad"
name: "matrix-grad",
});
}
},
......@@ -825,7 +907,7 @@ export default {
// 请求主责人员
let formdata = new FormData();
formdata.append("organizationId", this.mainDutyDeptId);
postHdPeople(`/riskMain/getUserList`, formdata).then(res => {
postHdPeople(`/riskMain/getUserList`, formdata).then((res) => {
this.columnsMainDutyPeopLe = res.data;
});
},
......@@ -849,14 +931,14 @@ export default {
this.show = false;
},
onSave(e) {
if(e.id!=this.form.projectId){
this.form.buildingNames = ''
if (e.id != this.form.projectId) {
this.form.buildingNames = "";
}
this.form.projectId = e.id;
this.form.projectName = e.name;
this.form.projectBusiness = e.business;
this.show = false;
}
},
},
watch: {
setRank(newVal, oldVal) {
......@@ -866,12 +948,12 @@ export default {
this.showSetRankMode = false;
}
},
}
},
};
</script>
<style scoped>
/* @import url(); 引入css类 */
.building-select{
.building-select {
padding: 10px 30px;
}
</style>
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