1.12基础功能

main
bibi 3 years ago
parent a74ef209ab
commit 83dc074670

@ -1,3 +1,3 @@
NODE_ENV = 'development' NODE_ENV = 'development'
VUE_APP_URL = '' VUE_APP_URL = 'http://121.41.26.225:8004/1'
VUE_APP_CDN = '' VUE_APP_CDN = 'http://121.41.26.225:8004/1'

@ -1,3 +1,3 @@
NODE_ENV = 'production' NODE_ENV = 'production'
VUE_APP_URL = '' VUE_APP_URL = 'http://121.41.26.225:8004/1'
VUE_APP_CDN = '' VUE_APP_CDN = 'http://121.41.26.225:8004/1'

@ -1,8 +1,5 @@
<template> <template>
<div> <div>
<a-button type="primary" @click="showDrawer">
<a-icon type="plus" /> New account
</a-button>
<a-drawer <a-drawer
title="抽屉" title="抽屉"
:width="720" :width="720"

@ -39,8 +39,16 @@
" "
> >
<!-- 外头传进来的操作栏信息data为表格循环出来的当前行数据信息 --> <!-- 外头传进来的操作栏信息data为表格循环出来的当前行数据信息 -->
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, row">
<slot name="actionBox" :data="record"></slot> <slot name="actionBox" :data="row"></slot>
</span>
<span slot="tags" slot-scope="tags">
<a-tag
v-for="tag,index in tags"
:key="index"
>
{{ formatter(tag) }}
</a-tag>
</span> </span>
</a-table> </a-table>
</div> </div>
@ -101,6 +109,9 @@ export default {
this.$emit("Actions", val); this.$emit("Actions", val);
this.activeAction = undefined this.activeAction = undefined
}, },
formatter(val){
this.$emit("formatter", val);
}
}, },
}; };
</script> </script>

@ -73,49 +73,49 @@ export default [
} }
] ]
}, },
{ // {
path: '/attendance', // path: '/attendance',
name: "Attendance", // name: "Attendance",
title: "考勤管理", // title: "考勤管理",
icon: 'reconciliation', // icon: 'reconciliation',
hide: false, // hide: false,
redirect: '/attendance/record', // redirect: '/attendance/record',
component: resolve => require(['@/views/Basic/Attendance'], resolve), // component: resolve => require(['@/views/Basic/Attendance'], resolve),
meta: {title: '考勤管理'}, // meta: {title: '考勤管理'},
children: [ // children: [
{ // {
path: '/attendance/record', // path: '/attendance/record',
name: "Attendance_record", // name: "Attendance_record",
title: "考勤记录", // title: "考勤记录",
hide: false, // hide: false,
component: resolve => require(['@/views/Basic/Attendance/_record'], resolve), // component: resolve => require(['@/views/Basic/Attendance/_record'], resolve),
meta: {title: '考勤记录'}, // meta: {title: '考勤记录'},
}, // },
{ // {
path: '/attendance/application', // path: '/attendance/application',
name: "Attendance_application", // name: "Attendance_application",
title: "申请记录", // title: "申请记录",
hide: false, // hide: false,
component: resolve => require(['@/views/Basic/Attendance/application'], resolve), // component: resolve => require(['@/views/Basic/Attendance/application'], resolve),
meta: {title: '申请记录'}, // meta: {title: '申请记录'},
}, // },
{ // {
path: '/attendance/attendanceteam', // path: '/attendance/attendanceteam',
name: "Attendance_attendanceteam", // name: "Attendance_attendanceteam",
title: "考勤小组", // title: "考勤小组",
hide: false, // hide: false,
component: resolve => require(['@/views/Basic/Attendance/_attendanceteam'], resolve), // component: resolve => require(['@/views/Basic/Attendance/_attendanceteam'], resolve),
meta: {title: '考勤小组'}, // meta: {title: '考勤小组'},
}, // },
{ // {
path: '/attendance/scheduling', // path: '/attendance/scheduling',
name: "Attendance_scheduling", // name: "Attendance_scheduling",
title: "排班计划", // title: "排班计划",
hide: false, // hide: false,
component: resolve => require(['@/views/Basic/Attendance/_scheduling'], resolve), // component: resolve => require(['@/views/Basic/Attendance/_scheduling'], resolve),
meta: {title: '排班计划'}, // meta: {title: '排班计划'},
}, // },
] // ]
} // }
] ]

@ -63,4 +63,7 @@
background: #fff; background: #fff;
text-align: right; text-align: right;
z-index : 1; z-index : 1;
}
.ant-modal-content{
margin-top:100px;
} }

@ -24,9 +24,10 @@
@selectionChoosed="selectionChoosed" @selectionChoosed="selectionChoosed"
> >
<template v-slot:actionBox="data"> <template v-slot:actionBox="data">
<a href="javascript:;" @click="del(data)"></a> <a-space size="small">
<span style="margin: 5px">|</span> <a-button type="link" @click='detail(data)'>分配角色</a-button>
<a href="javascript:;">删除</a> <a-button type="link" @click='del(data)'>删除</a-button>
</a-space>
</template> </template>
</commonTable> </commonTable>
</a-col> </a-col>
@ -51,17 +52,17 @@ export default {
{ {
title: "真实姓名", title: "真实姓名",
dataIndex: "actualName", dataIndex: "actualName",
width: "200", width: "20%",
}, },
{ {
title: "手机号", title: "手机号",
dataIndex: "tel", dataIndex: "tel",
width: "200", width: "20%",
}, },
{ {
title: "角色", title: "角色",
dataIndex: "roleNameList", dataIndex: "roleNameList",
width: "200", width: "20%",
customRender:function(roleNameList){ customRender:function(roleNameList){
return roleNameList.toString(); return roleNameList.toString();
} }
@ -69,7 +70,7 @@ export default {
{ {
title: "备注", title: "备注",
dataIndex: "remake", dataIndex: "remake",
width: "200", width: "20%",
}, },
{ {
title: "操作", title: "操作",
@ -83,27 +84,6 @@ export default {
// //
tableData: [ tableData: [
{ name: 1, roleNameList: ['点点3','212','点点'] }, { name: 1, roleNameList: ['点点3','212','点点'] },
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
], ],
ActionsList: [ ActionsList: [
{ {
@ -126,7 +106,15 @@ export default {
this.pagination = pager; this.pagination = pager;
}, },
del(data) { del(data) {
console.log(data); this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
}, },
Actions(data) { Actions(data) {
console.log(data); console.log(data);

@ -2,17 +2,17 @@
<div class="main"> <div class="main">
<a-row> <a-row>
<!-- 组织架构 --> <!-- 组织架构 -->
<a-col :span="4" class="left-tree"> <a-col :span="5" class="left-tree">
<a-input-search <a-input-search
style="margin-bottom: 8px" style="margin-bottom: 8px"
placeholder="请输入搜索信息" placeholder="请输入搜索信息"
@change="onChange" @change="onChange"
/> />
<a-space> <div>
<a-button type="link">+&nbsp;&nbsp;新建分组</a-button> <a-button type="link">+&nbsp;新建分组</a-button>
<a-button type="link" icon="form"> </a-button> <a-button type="link" icon="form"> </a-button>
<a-button type="link" style="color:#FF4D4F" icon="delete" @click="del()"> </a-button> <a-button type="link" style="color:#FF4D4F" icon="delete" @click="del()"> </a-button>
</a-space> </div>
<a-tree <a-tree
checkable checkable
v-model="checkedKeys" v-model="checkedKeys"
@ -25,7 +25,7 @@
/> />
</a-col> </a-col>
<!-- right 员工 --> <!-- right 员工 -->
<a-col :span="20"> <a-col :span="19">
<div class="search-box"> <div class="search-box">
<a-space size="large"> <a-space size="large">
<a-input placeholder="请输入申请人/公司名" /> <a-input placeholder="请输入申请人/公司名" />
@ -69,11 +69,10 @@
> >
<!-- 操作 --> <!-- 操作 -->
<span slot="action" slot-scope="scope"> <span slot="action" slot-scope="scope">
<a @click="detail(scope)"></a> <a-space size="small">
<span style="margin: 5px">|</span> <a-button type="link" @click='detail(scope)'>详情</a-button>
<a-switch size="small"></a-switch> <a-button type="link" @click='del(scope)'>重置密码</a-button>
<span style="margin: 5px">|</span> </a-space>
<a @click="detail(scope)"></a>
</span> </span>
<span slot="formatter" slot-scope="scope">{{ <span slot="formatter" slot-scope="scope">{{
scope === 1 ? "可" : "" scope === 1 ? "可" : ""
@ -347,22 +346,22 @@ export default {
{ {
title: "真实名称", title: "真实名称",
dataIndex: "actualName", dataIndex: "actualName",
width: "200", width: "20%",
}, },
{ {
title: "手机号", title: "手机号",
dataIndex: "tel", dataIndex: "tel",
width: "200", width: "20%",
}, },
{ {
title: "所属部门", title: "所属部门",
dataIndex: "departmentName", dataIndex: "departmentName",
width: "200", width: "20%",
}, },
{ {
title: "岗位", title: "岗位",
dataIndex: "positionName", dataIndex: "positionName",
width: "200", width: "20%",
}, },
{ {
title: "备注", title: "备注",
@ -379,7 +378,7 @@ export default {
}, },
], ],
// //
tableData: [], tableData: [{},],
// //
pagination: { pagination: {
current: 1, current: 1,

@ -24,14 +24,15 @@
@selectionChoosed="selectionChoosed" @selectionChoosed="selectionChoosed"
> >
<template v-slot:actionBox="data"> <template v-slot:actionBox="data">
<a href="javascript:;" @click="del(data)"></a> <a-space size="small">
<span style="margin: 5px">|</span> <a-button type="link" @click='detail(data)'>详情</a-button>
<a href="javascript:;">删除</a> <a-button type="link" @click='del(data)'>删除</a-button>
</a-space>
</template> </template>
</commonTable> </commonTable>
<!-- 添加 --> <!-- 添加 -->
<a-drawer <a-drawer
:title="drawerConfig.title" title="添加楼栋"
:width="720" :width="720"
:visible="drawerConfig.addShow" :visible="drawerConfig.addShow"
:body-style="{ paddingBottom: '80px' }" :body-style="{ paddingBottom: '80px' }"
@ -67,6 +68,70 @@
<a-button type="primary" @click="addClose"> </a-button> <a-button type="primary" @click="addClose"> </a-button>
</div> </div>
</a-drawer> </a-drawer>
<!-- 详情 -->
<a-drawer
title="楼栋详情"
:width="720"
:visible="drawerConfig.detailShow"
:body-style="{ paddingBottom: '80px' }"
@close="detailClose"
>
<!-- 编辑 -->
<div class="drawer-content" v-if="drawerConfig.editNow">
楼栋信息
<a-divider></a-divider>
<a-form-model
layout='vertical'
ref="ruleForm"
:model="form"
:rules="rules"
>
<a-form-model-item label="楼栋号" prop="name">
<a-input v-model="form.name" placeholder='请输入楼栋号' style="width:50%"/>
</a-form-model-item>
<a-form-model-item label='上传照片' style="width:70%" prop='fileList'>
</a-form-model-item>
</a-form-model>
</div>
<!-- 详情 -->
<div class="drawer-content" v-else>
楼栋信息
<a-divider></a-divider>
<a-form
layout='vertical'
>
<a-form-item label="楼栋号" prop="name">
<span>1</span>
</a-form-item>
<a-form-item label='上传照片' style="width:70%" >
</a-form-item>
</a-form>
单元信息
<a-divider></a-divider>
<a-table :columns="unitColumns" :data-source="unitData">
<span slot="action" slot-scope="text, row">
<a-button @click="edit(text,row)"></a-button>
<a-button @click="del(text,row)"></a-button>
</span>
</a-table>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="detailClose">
关闭
</a-button>
<a-button type="primary" @click="detailClose" v-if="drawerConfig.editNow"> </a-button>
<a-button type="primary" @click="drawerConfig.editNow=true" v-else> </a-button>
</div>
</a-drawer>
<a-modal
title="新增单元"
:visible="addUnitShow"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
>
<div></div>
</a-modal>
</div> </div>
</template> </template>
@ -78,21 +143,21 @@ export default {
addShow:false, addShow:false,
detailShow:false, detailShow:false,
title:'添加楼栋', title:'添加楼栋',
editNow:false,
}, },
addUnitShow:false,
form:{ form:{
name:'' name:''
}, },
rules:{ rules:{
name:[{required:true,message:'请输入楼栋',trigger:'blur'}], name:[{required:true,message:'请输入楼栋',trigger:'blur'}],
fileList:[{required:true,message:'请上传文件'}] fileList:[{required:true}]
}, },
fileList: [ fileList: [
{ {
uid: '-1', uid: '-1',
name: 'xxx.png', name: 'xxx.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
thumbUrl: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
}, },
{ {
uid: '-2', uid: '-2',
@ -114,22 +179,22 @@ export default {
{ {
title: "楼栋名称", title: "楼栋名称",
dataIndex: "name", dataIndex: "name",
width: "200", width: "20%",
}, },
{ {
title: "房屋总数", title: "房屋总数",
dataIndex: "estateTotals", dataIndex: "estateTotals",
width: "200", width: "20%",
}, },
{ {
title: "租赁房屋数", title: "租赁房屋数",
dataIndex: "leaseEstateNums", dataIndex: "leaseEstateNums",
width: "200" width: "20%"
}, },
{ {
title: "租赁率", title: "租赁率",
dataIndex: "leaseRate", dataIndex: "leaseRate",
width: "200", width: "20%",
customRender:function(leaseRate){ customRender:function(leaseRate){
return leaseRate+'%' return leaseRate+'%'
} }
@ -137,7 +202,7 @@ export default {
{ {
title: "入住率", title: "入住率",
dataIndex: "occupancyRate", dataIndex: "occupancyRate",
width: "200", width: "20%",
customRender:function(occupancyRate){ customRender:function(occupancyRate){
return occupancyRate+'%' return occupancyRate+'%'
} }
@ -151,30 +216,50 @@ export default {
scopedSlots: { customRender: "action" }, scopedSlots: { customRender: "action" },
}, },
], ],
unitData:[],
unitColumns: [
{
title: "单元名称",
dataIndex: "name",
width: "15%",
},
{
title: "楼层数",
dataIndex: "floor",
width: "15%",
},
{
title: "公共楼层数",
dataIndex: "publicFloor",
width: "18%",
},
{
title: "是否有电梯",
dataIndex: "elevator",
width: "18%",
customRender:function(elevator){
switch (elevator) {
case 1:
return '有'
case 0:
return '无'
default:
break;
}
}
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
// //
tableData: [ tableData: [
{ name: 1, roleNameList: ['点点3','212','点点'] }, { name: 1, roleNameList: ['点点3','212','点点'] },
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
], ],
ActionsList: [ ActionsList: [
{ {
@ -192,9 +277,27 @@ export default {
addBuilding(){ addBuilding(){
this.drawerConfig.addShow = true this.drawerConfig.addShow = true
}, },
addSubmit(){
this.$refs.ruleForm.validate(valid => {
if (valid) {
alert('submit!');
} else {
console.log('error submit!!');
return false;
}
});
},
addClose(){ addClose(){
this.drawerConfig.addShow = false this.drawerConfig.addShow = false
}, },
detail(data){
console.log(data);
this.drawerConfig.detailShow = true;
},
detailClose(){
this.drawerConfig.detailShow = false;
this.drawerConfig.editNow = false;
},
handleTableChange(pagination) { handleTableChange(pagination) {
console.log(pagination); console.log(pagination);
const pager = { ...this.pagination }; const pager = { ...this.pagination };
@ -203,7 +306,15 @@ export default {
this.pagination = pager; this.pagination = pager;
}, },
del(data) { del(data) {
console.log(data); this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
}, },
Actions(data) { Actions(data) {
console.log(data); console.log(data);

@ -0,0 +1,333 @@
<template>
<div>
<div class="cardTitle">住户信息</div>
<div class="search-box">
<a-row>
<a-col :span="20">
<a-space size="large">
<a-select style="width: 200px" placeholder="请选择性别" >
<a-select-option value="1"></a-select-option>
<a-select-option value="2"></a-select-option>
<a-select-option value="3">保密</a-select-option>
</a-select>
<a-input style="width: 200px" placeholder="请输入关键字(姓名/手机号)" />
<a-button type="primary"> </a-button>
<a-button> </a-button>
</a-space>
</a-col>
<a-col :span="4">
<a-button class="add-btn" @click="drawer.add.show = true">添加住户</a-button>
</a-col>
</a-row>
</div>
<div class="main">
<div style="margin-bottom: 16px">
<!-- 批量操作 -->
<a-select
type="primary"
v-model="activeAction"
:disabled="!hasSelected"
:loading="loading"
style="width: 120px"
@change="Actions"
placeholder="请选择操作"
>
批量
<a-select-option v-for="item in ActionsList" :key="item.value">
{{ item.label }}
</a-select-option>
</a-select>
<span style="margin-left: 8px">
<template v-if="hasSelected">
{{ `已选择 ${selectedRowKeys.length}` }}
</template>
</span>
</div>
<!-- 表格 -->
<a-table
:columns="columns"
:data-source="newData"
:pagination="pagination"
:scroll="{ x: 1300 }"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed,
}"
:row-key="
(record, index) => {
return index;
}
"
>
<span slot="name" slot-scope="text, row">
<a-select style="width :200px" @change='changeHouse'>
<a-select-option v-for="item,index in row.residentListEstateVoList" :key='index' :value="item.id">
{{
item.manageBuildingName +
"栋/" +
item.manageUnitName +
"单元/" +
item.floorLocation +
"层-" +
item.manageEstateName +
"室"
}}
</a-select-option>
</a-select>
</span>
<span slot="action" slot-scope="text, row">
<a-space>
<a-button type="link" @click="edit(row)"></a-button>
<a-button type="link" @click="del(row)"></a-button>
</a-space>
</span>
<span slot="tags" slot-scope="tag">
<a-tag
:color="tag === 1 ? 'volcano' : tag === 2 ? 'geekblue' : tag === 3 ? 'geekblue' : 'red'"
>
{{ tag === 1 ? "业主" : tag === 2 ? "业主亲属" :tag === 3 ? "租户":'租户亲属' }}
</a-tag>
</span>
</a-table>
</div>
<!-- add -->
<a-drawer
title="新增住户"
:width="720"
:visible="drawer.add.show"
:body-style="{ paddingBottom: '80px' }"
@close="onClose"
>
<div class="drawer-content">
基本信息
<a-divider></a-divider>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="drawer.add.show = false">
关闭
</a-button>
<a-button type="primary" @click="onClose"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
export default {
data() {
return {
drawer:{
add:{
show: false
},
detail:{}
},
changeId:null,
pagination: {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
activeAction: undefined,
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
//
//
columns: [
{
title: "住户姓名",
dataIndex: "name",
width: "10%",
},
{
title: "住户手机号",
dataIndex: "tel",
width: "10%",
},
{
title: "住户性别",
dataIndex: "sex",
width: "8%",
customRender:function(sex){
switch (sex) {
case 1:
return '男'
case 2:
return '女'
case 3:
return '保密'
default:
break;
}
}
},
{
title: "住户身份证号",
dataIndex: "idCard",
width: "10%",
},
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "房屋类型",
dataIndex: "manageEstateTypeName",
width: "10%",
},
{
title: "用户身份",
key: "tags",
dataIndex: "identity",
scopedSlots: { customRender: "tags" },
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],newData:[],
//
tableData: [
{
"id": 1,
"name": "张三",
"tel": "13738611462",
"sex": 1,
"idCard": "331022199711273812",
"residentListEstateVoList": [
{
"id": 1,
"manageBuildingName": "1",
"manageUnitName": "单元1",
"floorLocation": 1,
"manageEstateName": "1室",
"manageEstateTypeName": "住宅",
"identity": 1
},
{
"id": 2,
"manageBuildingName": "2",
"manageUnitName": "单元2",
"floorLocation": 3,
"manageEstateName": "3室",
"manageEstateTypeName": "住宅",
"identity": 2
}
]
},
{
"id": 1,
"name": "张的三",
"tel": "13738611462",
"sex": 1,
"idCard": "331022199711273812",
"residentListEstateVoList": [
{
"id": 3,
"manageBuildingName": "3",
"manageUnitName": "单元3",
"floorLocation": 3,
"manageEstateName": "3室",
"manageEstateTypeName": "住宅",
"identity": 3
},{
"id": 4,
"manageBuildingName": "4",
"manageUnitName": "单元4",
"floorLocation": 4,
"manageEstateName": "4室",
"manageEstateTypeName": "住宅",
"identity": 4
}
]
},
],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
};
},
mounted(){
this.newData = this.tableData
},
methods: {
//
changeHouse(value){
//
this.newData.forEach((item,index)=>{
//
item.residentListEstateVoList.forEach(items=>{
// idchangeid
if(items.id === value){
// newData
this.$set(this.newData[index],'identity' ,items.identity )
this.$set(this.newData[index],'manageEstateTypeName' ,items.manageEstateTypeName )
}
})
})
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
this.activeAction = undefined;
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
computed: {
// selection
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
};
</script>
<style lang="less" scoped>
.role-card {
line-height: 30px;
font-size: 16px;
cursor: pointer;
border-bottom: 1px solid #d9d9d9;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
}
</style>

@ -1,58 +1,357 @@
<template> <template>
<div> <div>
<!-- 人员表格 --> <div class="cardTitle">房屋管理</div>
<commonTable <div class="search-box">
:columns="columns" <a-row>
:tableData="tableData" <a-col :span="20">
:ActionsList="ActionsList" <a-space size="large">
@handleTableChange="handleTableChange" <a-input placeholder="请输入房屋名称" />
@Actions="Actions" <a-select style="width: 200px" placeholder="请选择房屋类型" />
@selectionChoosed="selectionChoosed" <a-select style="width: 200px" placeholder="请选择是否开启租赁" />
<a-button type="primary"> </a-button>
<a-button> </a-button>
</a-space>
</a-col>
<a-col :span="4">
<a-button class="add-btn" @click="drawerConfig.addShow = true">添加房屋</a-button>
</a-col>
</a-row>
</div>
<div class="main">
<div style="margin-bottom: 16px">
<!-- 批量操作 -->
<a-select
type="primary"
v-model="activeAction"
:disabled="!hasSelected"
:loading="loading"
style="width: 120px"
@change="Actions"
placeholder="请选择操作"
> >
<template v-slot:actionBox="data"> 批量
<a href="javascript:;" @click="del(data)"></a> <a-select-option v-for="item in ActionsList" :key="item.value">
<span style="margin: 5px">|</span> {{ item.label }}
<a href="javascript:;">删除</a> </a-select-option>
</a-select>
<span style="margin-left: 8px">
<template v-if="hasSelected">
{{ `已选择 ${selectedRowKeys.length}` }}
</template> </template>
</commonTable> </span>
</div>
<!-- 表格 -->
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 1300 }"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed,
}"
:row-key="
(record, index) => {
return index;
}
"
>
<span slot="name" slot-scope="text, row">
{{
row.manageBuildingName +
"栋/" +
row.manageUnitName +
"单元/" +
row.floorLocation +
"层-" +
row.name +
"室"
}}
</span>
<span slot="action" slot-scope="text, row">
<a-space>
<a-button type="link" @click="edit(row)"></a-button>
<a-button type="link" @click="del(row)"></a-button>
</a-space>
</span>
<span slot="tags" slot-scope="tag">
<a-tag
:color="tag === 1 ? 'volcano' : tag === 2 ? 'geekblue' : 'green'"
>
{{ tag === 1 ? "闲置" : tag === 2 ? "在住" : "在租" }}
</a-tag>
</span>
<span slot="switch" slot-scope="switchV, row">
<a-switch :checked="switchV === 1" @change="enable(row)"></a-switch>
</span>
</a-table>
</div>
<a-drawer
title="添加房屋"
:width="720"
:visible="drawerConfig.addShow"
:body-style="{ paddingBottom: '80px' }"
@close="addClose"
>
<div class="drawer-content">
基本信息
<a-divider></a-divider>
<a-form-model
layout="vertical"
ref="ruleForm"
:model="form"
:rules="rules"
:wrapper-col="{span:18}"
>
<a-row>
<a-col :span="12">
<a-form-model-item label="楼栋" prop="manageBuildingId">
<a-select
v-model="form.manageBuildingId"
placeholder="请选择楼栋"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="单元" prop="manageUnitId">
<a-select
v-model="form.manageUnitId"
placeholder="请选择单元"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="楼层" prop="floorLocation">
<a-select
v-model="form.floorLocation"
placeholder="请选择楼层"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="房屋名称" prop="name">
<a-input
v-model="form.name"
placeholder="请输入房屋名称"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="室内面积" prop="indoorArea">
<a-input
type="number"
v-model="form.indoorArea"
placeholder="请输入室内面积"
suffix="㎡"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="建筑面积" prop="constructionArea">
<a-input
v-model="form.constructionArea"
type="number"
suffix="㎡"
placeholder="请输入建筑面积"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="房屋类型" prop="manageEstateTypeId">
<a-select
mode="multiple"
v-model="form.manageEstateTypeId"
placeholder="请选择房屋类型"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="是否开启租赁" prop="isEnableLease">
<a-select
v-model="form.isEnableLease"
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<div>房屋户型</div>
</a-col>
<a-col :span="4">
<a-form-model-item label="厅" prop="houseTypeHall">
<a-input
type="number"
:min="0"
v-model="form.houseTypeHall"
/>
</a-form-model-item>
</a-col>
<a-col :span="4">
<a-form-model-item label="室" prop="houseTypeRoom">
<a-input
type="number"
:min="0"
v-model="form.houseTypeRoom"
/>
</a-form-model-item>
</a-col>
<a-col :span="4">
<a-form-model-item label="卫" prop="houseTypeBathroom">
<a-input
type="number"
:min="0"
v-model="form.houseTypeBathroom"
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="房屋照片" prop="estateImgUrls">
<a-upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
list-type="picture-card"
:file-list="fileList"
@preview="handlePreview"
@change="handleChange"
>
<div v-if="fileList.length < 8">
<a-icon type="plus" />
<div class="ant-upload-text">
Upload
</div>
</div>
</a-upload>
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
<img alt="example" style="width: 100%" :src="previewImage" />
</a-modal>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="备注" prop="remarks">
<a-textarea v-model="form.remarks" :rows="4"/>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="addClose">
关闭
</a-button>
<a-button type="primary" @click="addClose"> </a-button>
</div>
</a-drawer>
</div> </div>
</template> </template>
<script> <script>
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
export default { export default {
data() { data() {
return { return {
tableChoosed: [], drawerConfig:{
// addShow:false,
},
previewVisible: false,
previewImage: '',
fileList: [
{
uid: '-1',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-2',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-3',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-4',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-5',
name: 'image.png',
status: 'error',
},
],
form:{
manageBuildingId:undefined,
manageUnitId:undefined,
floorLocation:undefined,
name:undefined,
indoorArea:undefined,
constructionArea:undefined,
manageEstateTypeId:undefined,
isEnableLease:undefined,
houseTypeHall:undefined,
houseTypeRoom:undefined,
houseTypeBathroom:undefined,
estateImgUrls:undefined,
remarks:undefined,
},
rules:{},
pagination: { pagination: {
current: 1, current: 1,
total: 0, total: 0,
pageSize: 10, pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}, },
activeAction: undefined,
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
//
// //
columns: [ columns: [
{ {
title: "真实姓名", title: "房屋名称",
dataIndex: "actualName", dataIndex: "manageBuildingName",
width: "200", scopedSlots: { customRender: "name" },
width: "20%",
}, },
{ {
title: "手机号", title: "室内面积",
dataIndex: "tel", dataIndex: "indoorArea",
width: "200", width: "15%",
}, },
{ {
title: "角色", title: "建筑面积",
dataIndex: "roleNameList", dataIndex: "constructionArea",
width: "200", width: "15%",
customRender:function(roleNameList){
return roleNameList.toString();
}
}, },
{ {
title: "备注", title: "房屋类型",
dataIndex: "remake", dataIndex: "manageEstateTypeName",
width: "200", width: "15%",
},
{
title: "居住状态",
key: "tags",
dataIndex: "status",
scopedSlots: { customRender: "tags" },
},
{
title: "是否开启租赁",
dataIndex: "isEnableLease",
scopedSlots: { customRender: "switch" },
}, },
{ {
title: "操作", title: "操作",
@ -65,9 +364,28 @@ export default {
], ],
// //
tableData: [ tableData: [
{ name: 1, roleNameList: ['点点3','212','点点'] }, {
{}, manageBuildingName: "1",
manageUnitName: "2",
floorLocation: "4",
name: "502",
roleNameList: ["点点3", "212", "点点"],
status: 1,
},
{
name: 1,
roleNameList: ["点点3", "212", "点点"],
status: 2,
isEnableLease: 1,
},
{
name: 1,
roleNameList: ["点点3", "212", "点点"],
status: 3,
isEnableLease: 0,
},
{}, {},
{ isEnableLease: 1 },
{}, {},
{}, {},
{}, {},
@ -101,6 +419,23 @@ export default {
}; };
}, },
methods: { methods: {
addHouse() {},
handleCancel() {
this.previewVisible = false;
},
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
handleChange({ fileList }) {
this.fileList = fileList;
},
enable(data) {
console.log(data);
},
handleTableChange(pagination) { handleTableChange(pagination) {
console.log(pagination); console.log(pagination);
const pager = { ...this.pagination }; const pager = { ...this.pagination };
@ -109,21 +444,39 @@ export default {
this.pagination = pager; this.pagination = pager;
}, },
del(data) { del(data) {
console.log(data); this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
}, },
Actions(data) { Actions(data) {
console.log(data); console.log(data);
this.activeAction = undefined;
}, },
selectionChoosed(data) { selectionChoosed(data) {
console.log(data); console.log(data);
this.tableChoosed = data; this.tableChoosed = data;
}, },
addClose(){
this.drawerConfig.addShow = false;
}
},
computed: {
// selection
hasSelected() {
return this.selectedRowKeys.length > 0;
},
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.role-card{ .role-card {
line-height: 30px; line-height: 30px;
font-size: 16px; font-size: 16px;
cursor: pointer; cursor: pointer;

Loading…
Cancel
Save