wangyx 3 months ago
parent
commit
94611ad92f
  1. 2
      .env.development
  2. 56
      src/api/mz/rec.js
  3. 4
      src/views/mz/dept/index.vue
  4. 93
      src/views/mz/house/index.vue
  5. 26
      src/views/records/roomselection/index.vue
  6. 3
      src/views/residence/checkIn/index.vue
  7. 2
      vue.config.js

2
.env.development

@ -5,7 +5,7 @@ VUE_APP_TITLE = 青岛免租金住房服务平台
ENV = 'development' ENV = 'development'
# 青岛市免租金住宿保障平台/开发环境 # 青岛市免租金住宿保障平台/开发环境
VUE_APP_BASE_API = 'http://192.168.1.144:8080/mz-api' VUE_APP_BASE_API = 'http://219.146.91.110:30801/mz-api'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

56
src/api/mz/rec.js

@ -1,44 +1,56 @@
import request from '@/utils/request' import request from '@/utils/request'
// 查询选房记录列表 // 查询选房记录列表
export function listRec(query) { export function listRecselect(data) {
return request({ return request({
url: '/mz/rec/list', url: '/apartment/manager/chooseRoomRecs',
method: 'get', method: 'post',
params: query data
}) })
} }
// 查询选房记录详细 // 查询选房记录详细
export function getRec(id) { export function getRecSelectInfo(id) {
return request({ return request({
url: '/mz/rec/' + id, url: '/apartment/manager/chooseRoomRecDetail?chooseRoomRecId=' + id,
method: 'get' method: 'get'
}) })
} }
// 查询入住记录列表
// 新增选房记录 export function listRecCheckin(data) {
export function addRec(data) {
return request({ return request({
url: '/mz/rec', url: '/apartment/manager/listCheckInRecs',
method: 'post', method: 'post',
data: data data
}) })
} }
// 查询选房记录详细
// 修改选房记录 export function getRecCheckinInfo(id) {
export function updateRec(data) {
return request({ return request({
url: '/mz/rec', url: '/apartment/manager/checkInRecDetail?checkInRecId=' + id,
method: 'put', method: 'get'
data: data
}) })
} }
// 查询退房记录列表
// 删除选房记录 export function listCheckOutRec(data) {
export function delRec(id) { return request({
url: '/apartment/manager/listCheckOutRec',
method: 'post',
data
})
}
// 查询退房记录详细
export function getRecCheckOutInfo(id) {
return request({ return request({
url: '/mz/rec/' + id, url: '/apartment/manager/checkOutRecDetail?checkOutRecId=' + id,
method: 'delete' method: 'get'
})
}
// 房屋三级联动
export function queryDeptDropdownList(query) {
return request({
url: '/system/dept/queryDeptDropdownList',
method: 'get',
params: query
}) })
} }

4
src/views/mz/dept/index.vue

@ -50,9 +50,9 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button> <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['mz:house:edit']">修改</el-button> v-hasPermi="['mz:dept:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['mz:house:remove']">删除</el-button> v-hasPermi="['mz:dept:remove']">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

93
src/views/mz/house/index.vue

@ -2,9 +2,7 @@
<div class="app-container"> <div class="app-container">
<div class="flex w-full h-full"> <div class="flex w-full h-full">
<div class="tree mr-10 card"> <div class="tree mr-10 card">
<el-tree :data="treeList" :props="defaultProps" @node-click="handleNodeClick" :default-expanded-keys="expandedKeys" :default-checked-keys="checkedKeys" :auto-expand-parent="true" <el-tree :data="treeList" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
:expand-on-click-node="false" :highlight-current="true" ref="tree" node-key="deptId"
:accordion="true"></el-tree>
</div> </div>
<div class="card flex-1" style="width: calc(100% - 170px)"> <div class="card flex-1" style="width: calc(100% - 170px)">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
@ -124,7 +122,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="form.hire === '2'">
<el-col :span="12">
<el-form-item label="最大可租住天数" prop="days" >
<el-input-number v-model="form.days" :min="0" placeholder="请输入建筑面积" style="width: 200px;" :disabled="disabled"/>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex" style="margin-bottom:10px"> <el-row type="flex" style="margin-bottom:10px">
<el-col :span="12"> <el-col :span="12">
<el-col :span="6" type="flex" style="text-align:right;margin-right:15px;height: 100%;align-items: center;display: flex;justify-content: end;"> <el-col :span="6" type="flex" style="text-align:right;margin-right:15px;height: 100%;align-items: center;display: flex;justify-content: end;">
@ -235,7 +239,8 @@ export default {
houseTypeId: null, houseTypeId: null,
remark: null, remark: null,
floor: 0, floor: 0,
hire:'1', hire:'',
days:null,
}, },
// //
rules: { rules: {
@ -260,7 +265,9 @@ export default {
hire: [ hire: [
{ required: true, message: '请选择长租房/短租房', trigger: 'change' } { required: true, message: '请选择长租房/短租房', trigger: 'change' }
], ],
days: [
{ validator: validateDays, trigger: 'blur' }
],
}, },
deptList: [], deptList: [],
defaultProps: { defaultProps: {
@ -273,10 +280,7 @@ export default {
buildingOption: [], buildingOption: [],
unitOptions: [], unitOptions: [],
disabled:false, disabled:false,
treeList:[], treeList:[]
expandedKeys: [],// key
checkedKeys: [],// key
showTree: true,
}; };
}, },
components: { components: {
@ -374,7 +378,11 @@ export default {
remark: null, remark: null,
floor: 0, floor: 0,
hire:'1', hire:'1',
days:null,
}; };
this.buildingOption = [];
this.unitOptions = [];
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -488,70 +496,9 @@ export default {
this.form.unitId = ''; this.form.unitId = '';
this.unitOptions = []; this.unitOptions = [];
await this.getUnitbyBuddingId(this.form.buildingId) await this.getUnitbyBuddingId(this.form.buildingId)
}, }
//
handleExpandTree(apartmentId) {
if (!apartmentId) return;
const targetId = Number(apartmentId);
const findParents = (node, targetId, parents = []) => {
if (Number(node.deptId) === targetId) {
return [...parents, node.deptId];
}
if (node.children) {
for (let child of node.children) {
const result = findParents(child, targetId, [...parents, node.deptId]);
if (result) return result;
}
}
return null;
};
let path = null;
for (let node of this.treeList) {
path = findParents(node, targetId);
if (path) break;
}
if (path) {
// :accordion="true"
this.expandedKeys = path;
this.checkedKeys = [path[path.length - 1]];
} else {
console.warn('未找到匹配的节点路径');
}
},
}, },
watch:{ watch:{}
$route: {
handler: function (newVal, oldVal) {
if (newVal.query) {
this.queryParams = {
...this.queryParams,
...newVal.query,
};
this.treeList = [];
this.showTree = false;
this.$nextTick(() => {
// el-tree
this.showTree = true;
this.getList();
// deptList
if (this.treeList.length === 0) {
this.getDeptList().then(() => {
this.handleExpandTree(newVal.query.deptId);
});
} else {
this.handleExpandTree(newVal.query.deptId);
}
});
} else {
this.getDeptList()
}
},
immediate: true,
deep: true,
},
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

26
src/views/records/roomselection/index.vue

@ -54,7 +54,12 @@
<el-input v-model="queryParams.graduateIdCard" placeholder="请输入身份证号码" clearable style="width: 220px" <el-input v-model="queryParams.graduateIdCard" placeholder="请输入身份证号码" clearable style="width: 220px"
@keyup.enter.native="handleQuery" /> @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<!-- 状态 -->
<el-form-item label="状态" prop="state">
<el-select v-model="queryParams.state" placeholder="请选择状态" style="width: 220px" @keyup.enter.native="handleQuery">
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
</el-form-item> </el-form-item>
@ -83,11 +88,11 @@
<el-table-column label="计划退房日期" align="center" prop="checkOutDate" width="160" /> <el-table-column label="计划退房日期" align="center" prop="checkOutDate" width="160" />
<el-table-column label="办理入住时间" align="center" prop="handleCheckInDate" width="160" /> <el-table-column label="办理入住时间" align="center" prop="handleCheckInDate" width="160" />
<!-- 居住状态 --> <!-- 居住状态 -->
<!-- <el-table-column label="当前状态" prop="state"> <el-table-column label="当前状态" prop="state">
<template slot-scope="scope"> <template slot-scope="scope">
<span :style="{ 'color': scope.row.state === 0 ? '#08b3b3' : scope.row.state === 6 ? '#fa9e0a' : '#c5cbda' }">{{ stateComp(scope.row.state) }}</span> <span :style="{ 'color': scope.row.state === 0 ? '#08b3b3' : scope.row.state === 6 ? '#fa9e0a' : '#c5cbda' }">{{ stateComp(scope.row.state) }}</span>
</template> </template>
</el-table-column> --> </el-table-column>
<!-- 入住评价 --> <!-- 入住评价 -->
<el-table-column label="原因说明" align="center" prop="evaluation" /> <el-table-column label="原因说明" align="center" prop="evaluation" />
@ -120,8 +125,8 @@
<el-col :span="8" class="mb-10">退房日期{{ info.checkOutDate }}</el-col> <el-col :span="8" class="mb-10">退房日期{{ info.checkOutDate }}</el-col>
<el-col :span="24" class="mb-10">入住办理时间{{ info.handleCheckInDate }}</el-col> <el-col :span="24" class="mb-10">入住办理时间{{ info.handleCheckInDate }}</el-col>
<!-- <el-col :span="8" class="mb-10">当前状态{{ stateComp(info.state) }}</el-col> <el-col :span="8" class="mb-10">当前状态{{ stateComp(info.state) }}</el-col>
<el-col :span="8" class="mb-10"></el-col> --> <el-col :span="8" class="mb-10"></el-col>
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="open = false"> </el-button> <el-button type="primary" @click="open = false"> </el-button>
@ -176,6 +181,11 @@ export default {
unitOptions: [], unitOptions: [],
houseOptions: [], houseOptions: [],
open: false, open: false,
statusOptions: [
{ value: "0", label: "未入住" },
{ value: "1", label: "入住中" },
{ value: "2", label: "已退房" },
],
}; };
}, },
watch: { watch: {
@ -248,9 +258,9 @@ export default {
}); });
}); });
}, },
// stateComp(val) { stateComp(val) {
// return this.statusOptions.find((item) => item.value == val)?.label; return this.statusOptions.find((item) => item.value == val)?.label;
// }, },
/** 转换公寓数据结构 */ /** 转换公寓数据结构 */
normalizer(node) { normalizer(node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {

3
src/views/residence/checkIn/index.vue

@ -356,7 +356,6 @@ export default {
this.stepCompleted[2] = true; this.stepCompleted[2] = true;
return; return;
} }
} }
}, },
// 退 // 退
@ -366,6 +365,8 @@ export default {
id: this.userInfo.chooseRecId, // Id id: this.userInfo.chooseRecId, // Id
checkInDate: this.userInfo.checkInTime, // checkInDate: this.userInfo.checkInTime, //
checkOutDate: this.userInfo.checkOutTime, // 退 checkOutDate: this.userInfo.checkOutTime, // 退
houseId: this.userInfo.houseId, // Id
graduateId: this.userInfo.graduateId, // Id
}) })
if (res.code === 200) { if (res.code === 200) {
} }

2
vue.config.js

@ -36,7 +36,7 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://192.168.1.144:8088`, target: `http://219.146.91.110:30801`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "", ["^" + process.env.VUE_APP_BASE_API]: "",

Loading…
Cancel
Save