diff --git a/admin/src/views/pm/check/in-or-out/components/CheckIn.vue b/admin/src/views/pm/check/in-or-out/components/CheckIn.vue
index b10f017..21cb062 100644
--- a/admin/src/views/pm/check/in-or-out/components/CheckIn.vue
+++ b/admin/src/views/pm/check/in-or-out/components/CheckIn.vue
@@ -16,9 +16,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ label="钥匙交接状态"
+ :formatter="sysYesNoFormatter">
+ label="是否申请装修"
+ :formatter="sysYesNoFormatter">
item.id === cellValue)
- return owner ? `${owner.ownerName} (${owner.id})` : cellValue
+ return owner ? `${owner.ownerName}` : cellValue
} else if (row.userType === '2') {
// 租户类型
const tenant = this.tenantList.find(item => item.id === cellValue)
- return tenant ? `${tenant.tenantName} (${tenant.id})` : cellValue
+ return tenant ? `${tenant.tenantName}` : cellValue
}
return cellValue
},
@@ -338,10 +388,16 @@
const tenantHouse = this.tenantHouseList.find(item => item.id === cellValue)
if (tenantHouse) {
// 构建更友好的租赁信息显示格式
- return `月租金: ${tenantHouse.rentAmount || 0}元 - ${tenantHouse.rentBeginTime || ''}至${tenantHouse.rentEndTime || ''}`
+ return `${tenantHouse.rentBeginTime || ''}至${tenantHouse.rentEndTime || ''}`
}
return cellValue
},
+ // 是/否字典格式化
+ sysYesNoFormatter(row, column, cellValue) {
+ if (!cellValue) return ''
+ const dict = this.dict.type.sys_yes_no?.find(item => item.value === cellValue)
+ return dict ? dict.label : cellValue
+ },
}
}
diff --git a/admin/src/views/pm/check/in-or-out/components/CheckOut.vue b/admin/src/views/pm/check/in-or-out/components/CheckOut.vue
index bad27c7..84d0439 100644
--- a/admin/src/views/pm/check/in-or-out/components/CheckOut.vue
+++ b/admin/src/views/pm/check/in-or-out/components/CheckOut.vue
@@ -1,6 +1,11 @@
+
+
+
+
+
+ label="租赁信息">
+
+ {{ getCheckInName(scope.row.tenantHouseId) }}
+
+ label="水电费结清状态"
+ :formatter="sysYesNoFormatter">
import AddOrUpdate from '../../out/pmcheckout-add-and-update'
import * as api from '@/api/pmcheckout.js'
+ import * as checkInApi from '@/api/pmcheckin.js'
+ import * as tenantHouseApi from '@/api/pmtenanthouse.js'
+ import * as tenantApi from '@/api/pmtenant.js'
+ import * as ownerApi from '@/api/pmowner.js'
export default {
components: {
AddOrUpdate
},
+ dicts: ['sys_yes_no'],
data () {
return {
+ checkInList: [],
+ tenantHouseList: [], // 租赁信息列表
+ ownerList: [], // 业主列表
+ tenantList: [], // 租户列表
dataForm: {
tenantHouseId: '',
checkOutDate: '',
@@ -147,8 +165,23 @@
mounted() {
// 确保页面加载时自动查询
this.getDataList()
+ // 加载入住记录列表
+ this.loadCheckInList()
+ // 获取租赁信息列表
+ this.getTenantHouseList()
+ // 获取业主和租户列表
+ this.getOwnerList()
+ this.getTenantList()
},
methods: {
+ // 加载入住记录列表
+ loadCheckInList() {
+ checkInApi.pmcheckinListApi({ page: 1, limit: 9999 }).then(res => {
+ this.checkInList = res.list || []
+ }).catch(() => {
+ this.checkInList = []
+ })
+ },
// 重置表单
resetForm() {
this.dataForm = {
@@ -207,13 +240,68 @@
selectionChangeHandle (val) {
this.dataListSelections = val
},
- // 新增 / 修改
+ // 关闭弹窗
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
+ // 是/否字典格式化
+ sysYesNoFormatter(row, column, cellValue) {
+ if (!cellValue) return ''
+ const dict = this.dict.type.sys_yes_no?.find(item => item.value === cellValue)
+ return dict ? dict.label : cellValue
+ },
+ // 根据租赁信息ID获取业主/租户名称
+ getCheckInName(tenantHouseId) {
+ const checkIn = this.checkInList.find(item => item.tenantHouseId === tenantHouseId)
+ if (checkIn) {
+ return checkIn.userName
+ }
+ // 如果没有找到,尝试从租赁信息列表中查找
+ const tenantHouse = this.tenantHouseList.find(item => item.id === tenantHouseId)
+ if (tenantHouse) {
+ return `${tenantHouse.rentBeginTime || ''}至${tenantHouse.rentEndTime || ''}`
+ }
+ return tenantHouseId
+ },
+ // 获取入住记录的显示标签
+ getCheckInLabel(item) {
+ if (!item) return ''
+ let label = item.userName || ''
+ // 添加租赁时间范围
+ const tenantHouse = this.tenantHouseList.find(th => th.id === item.tenantHouseId)
+ if (tenantHouse) {
+ const timeRange = `${tenantHouse.rentBeginTime || ''}至${tenantHouse.rentEndTime || ''}`
+ label = `${label} (${timeRange})`
+ }
+ return label
+ },
+ // 获取租赁信息列表
+ getTenantHouseList() {
+ tenantHouseApi.pmtenanthouseListApi({ page: 1, limit: 1000 }).then(res => {
+ this.tenantHouseList = res.list || []
+ }).catch(e => {
+ console.error('获取租赁信息列表失败:', e)
+ })
+ },
+ // 获取业主列表
+ getOwnerList() {
+ ownerApi.pmownerListApi({ page: 1, limit: 1000 }).then(res => {
+ this.ownerList = res.list || []
+ }).catch(e => {
+ console.error('获取业主列表失败:', e)
+ })
+ },
+ // 获取租户列表
+ getTenantList() {
+ tenantApi.pmtenantListApi({ page: 1, limit: 1000 }).then(res => {
+ this.tenantList = res.list || []
+ }).catch(e => {
+ console.error('获取租户列表失败:', e)
+ })
+ },
// 删除处理(支持单个删除和批量删除)
deleteHandle (id) {
let ids = []
diff --git a/admin/src/views/pm/check/in/pmcheckin-add-and-update.vue b/admin/src/views/pm/check/in/pmcheckin-add-and-update.vue
index 7fe25c5..0f09cf1 100644
--- a/admin/src/views/pm/check/in/pmcheckin-add-and-update.vue
+++ b/admin/src/views/pm/check/in/pmcheckin-add-and-update.vue
@@ -5,16 +5,16 @@
:close-on-click-modal="false"
:visible.sync="visible">
-
+
-
@@ -38,7 +38,7 @@
-
+
-
+
+
+
+
@@ -97,12 +106,21 @@
-
+
+
+
+
-
+
@@ -140,7 +158,7 @@ import * as tenantApi from '@/api/pmtenant.js'
import * as ownerApi from '@/api/pmowner.js'
export default {
- dicts: ['dept_type'],
+ dicts: ['dept_type','sys_yes_no'],
data() {
return {
visible: false,
@@ -153,7 +171,7 @@ export default {
keyHandover: '',
propertyFeeStart: '',
decorationApply: '',
- decorationDeposit: '',
+ decorationDeposit: 0,
decorationPeriod: '',
handlerId: '',
remark: '',
@@ -162,22 +180,11 @@ export default {
ownerList: [], // 业主列表
tenantList: [], // 租户列表
dataRule: {
- tenantHouseId: [
- {
- required: function (rule, value, callback) {
- if (this.dataForm.userType === '2' && !value) {
- callback(new Error('租赁信息id 为必填项'))
- } else {
- callback()
- }
- }, message: '租赁信息id 为必填项', trigger: 'blur, change'
- }
- ],
userType: [
- {required: true, message: '入住类型(业主 / 租户) 为必填项', trigger: 'blur'}
+ {required: true, message: '入住类型 为必填项', trigger: 'blur'}
],
userId: [
- {required: true, message: '业主/租户 ID 为必填项', trigger: 'blur'}
+ {required: true, message: '业主/租户 为必填项', trigger: 'blur'}
],
}
}
@@ -186,6 +193,12 @@ export default {
'dataForm.userType'(newVal) {
// 当切换到业主类型时,不需要清空租赁信息id,只需要确保字段禁用
// 验证规则已经处理了条件性必填,所以这里不需要额外操作
+ // 重新加载租赁信息列表
+ this.getTenantHouseList()
+ },
+ 'dataForm.userId'() {
+ // 当用户ID变化时,重新加载租赁信息列表
+ this.getTenantHouseList()
}
},
methods: {
@@ -207,7 +220,12 @@ export default {
},
// 获取租赁信息列表
getTenantHouseList() {
- tenantHouseApi.pmtenanthouseListApi({page: 1, limit: 1000}).then(res => {
+ const params = {page: 1, limit: 1000}
+ // 当用户类型是租户时,添加rentId参数(使用userId作为rentId)
+ if (this.dataForm.userType === '2' && this.dataForm.userId) {
+ params.rentId = this.dataForm.userId
+ }
+ tenantHouseApi.pmtenanthouseListApi(params).then(res => {
this.tenantHouseList = res.list || []
}).catch(e => {
console.error('获取租赁信息列表失败:', e)
diff --git a/admin/src/views/pm/check/out/pmcheckout-add-and-update.vue b/admin/src/views/pm/check/out/pmcheckout-add-and-update.vue
index 8fdc40d..4c94d09 100644
--- a/admin/src/views/pm/check/out/pmcheckout-add-and-update.vue
+++ b/admin/src/views/pm/check/out/pmcheckout-add-and-update.vue
@@ -8,8 +8,10 @@
-
-
+
+
+
+
@@ -33,19 +35,28 @@
-
+
+
+
+
-
+
-
+
@@ -78,50 +89,37 @@
+
+
diff --git a/admin/src/views/pm/maintenance/order/index.vue b/admin/src/views/pm/maintenance/order/index.vue
index bca6abd..9b0f29f 100644
--- a/admin/src/views/pm/maintenance/order/index.vue
+++ b/admin/src/views/pm/maintenance/order/index.vue
@@ -4,42 +4,12 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
查询
重置
@@ -59,35 +29,43 @@
align="center"
width="50">
-
+
+
+
+
+
+
+
+ label="业主名称">
+
+ {{ getOwnerName(scope.row.ownerId) }}
+
-
-
+ label="房屋名称">
+
+ {{ getHouseName(scope.row.houseId) }}
+
+
+
+
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
diff --git a/admin/src/views/pm/pmowner/index.vue b/admin/src/views/pm/pmowner/index.vue
index 6ab10c6..6a3dd52 100644
--- a/admin/src/views/pm/pmowner/index.vue
+++ b/admin/src/views/pm/pmowner/index.vue
@@ -1,20 +1,8 @@
-
-
-
-
-
-
-
-
-
-
+
@@ -76,11 +64,7 @@
-
-
- {{ getDeptName(scope.row.deptId) }}
-
-
+
{{ getHouseName(scope.row.houseId) }}
@@ -116,7 +100,6 @@