|
@@ -21,7 +21,7 @@ import {
|
|
|
ElUpload,
|
|
ElUpload,
|
|
|
} from 'element-plus'
|
|
} from 'element-plus'
|
|
|
import {
|
|
import {
|
|
|
- AlertCircle,
|
|
|
|
|
|
|
+ AlertCircle, Delete,
|
|
|
Download,
|
|
Download,
|
|
|
Eye,
|
|
Eye,
|
|
|
FileText,
|
|
FileText,
|
|
@@ -50,12 +50,20 @@ export interface AContractInfo {
|
|
|
signContractUrl: string
|
|
signContractUrl: string
|
|
|
createTime: string
|
|
createTime: string
|
|
|
updateTime: string
|
|
updateTime: string
|
|
|
|
|
+ houseName: string
|
|
|
|
|
+ floor: string
|
|
|
|
|
+ building: string
|
|
|
|
|
+ assetType: string
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
interface AContractInfoListResponse extends BaseResponse {
|
|
interface AContractInfoListResponse extends BaseResponse {
|
|
|
data: PageType<AContractInfo>
|
|
data: PageType<AContractInfo>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+interface HouseInfoResponse extends BaseResponse {
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
interface CanBeReceiptDataReponse extends BaseResponse {
|
|
interface CanBeReceiptDataReponse extends BaseResponse {
|
|
|
data: {
|
|
data: {
|
|
|
zj: number //租金
|
|
zj: number //租金
|
|
@@ -292,6 +300,13 @@ const getList = async () => {
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
if (response.code === 200 && response.data) {
|
|
if (response.code === 200 && response.data) {
|
|
|
|
|
+ for (const item of response.data.records) {
|
|
|
|
|
+ const roomDetails = await getRoomDetailsData(item.simplifiedHouseId);
|
|
|
|
|
+ item.houseName = roomDetails.houseName ;
|
|
|
|
|
+ item.floor = roomDetails.floor;
|
|
|
|
|
+ item.building = roomDetails.building;
|
|
|
|
|
+ item.assetType = roomDetails.assetType;
|
|
|
|
|
+ }
|
|
|
tableData.value = response.data.records
|
|
tableData.value = response.data.records
|
|
|
total.value = response.data.total
|
|
total.value = response.data.total
|
|
|
currentPage.value = response.data.current || 1
|
|
currentPage.value = response.data.current || 1
|
|
@@ -306,6 +321,35 @@ const getList = async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+const getRoomDetailsData = async (simplifiedHouseId: any) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ loading.value = true
|
|
|
|
|
+ const res = await clientGet<
|
|
|
|
|
+ HouseInfoResponse
|
|
|
|
|
+ >('/asimplifiedHouseInfo/getById/' + simplifiedHouseId, {
|
|
|
|
|
+ })
|
|
|
|
|
+ if (res.code !== 200) {
|
|
|
|
|
+ ElMessage.error(res.msg)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!res.data) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ houseName: '/',
|
|
|
|
|
+ floor: '/',
|
|
|
|
|
+ building: '/',
|
|
|
|
|
+ assetType: '/',
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return res.data;
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('获取房屋详情失败:', error)
|
|
|
|
|
+ ElMessage.error('获取房屋详情失败')
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 搜索
|
|
// 搜索
|
|
|
const handleSearch = () => {
|
|
const handleSearch = () => {
|
|
|
currentPage.value = 1
|
|
currentPage.value = 1
|
|
@@ -624,6 +668,7 @@ const getCanBeReceiptData = async (contractId: string) => {
|
|
|
|
|
|
|
|
// 获取收据
|
|
// 获取收据
|
|
|
const gainReceipt = async (contractId: string, dto: ReceiptDto) => {
|
|
const gainReceipt = async (contractId: string, dto: ReceiptDto) => {
|
|
|
|
|
+ console.log(111,dto)
|
|
|
const convertReceiptDtoForBackend = (dto: ReceiptDto): any => {
|
|
const convertReceiptDtoForBackend = (dto: ReceiptDto): any => {
|
|
|
return {
|
|
return {
|
|
|
...dto,
|
|
...dto,
|
|
@@ -645,6 +690,8 @@ const gainReceipt = async (contractId: string, dto: ReceiptDto) => {
|
|
|
|
|
|
|
|
// 打开收据对话框
|
|
// 打开收据对话框
|
|
|
const openReceiptDialog = async (contractId: string, contractNumber: string) => {
|
|
const openReceiptDialog = async (contractId: string, contractNumber: string) => {
|
|
|
|
|
+ console.log(2222,userInfo.value?.personName)
|
|
|
|
|
+
|
|
|
currentReceiptContractId.value = contractId
|
|
currentReceiptContractId.value = contractId
|
|
|
currentReceiptContractNumber.value = contractNumber
|
|
currentReceiptContractNumber.value = contractNumber
|
|
|
receiptVisible.value = true
|
|
receiptVisible.value = true
|
|
@@ -661,7 +708,7 @@ const openReceiptDialog = async (contractId: string, contractNumber: string) =>
|
|
|
sf: 0,
|
|
sf: 0,
|
|
|
paymentReason: ['房屋租赁费用', '押金'],
|
|
paymentReason: ['房屋租赁费用', '押金'],
|
|
|
rzrq: '',
|
|
rzrq: '',
|
|
|
- operator: '',
|
|
|
|
|
|
|
+ operator: userInfo.value?.personName,
|
|
|
startDate: '',
|
|
startDate: '',
|
|
|
endDate: '',
|
|
endDate: '',
|
|
|
})
|
|
})
|
|
@@ -744,6 +791,7 @@ watch(
|
|
|
|
|
|
|
|
// 生成收据
|
|
// 生成收据
|
|
|
const generateReceipt = async () => {
|
|
const generateReceipt = async () => {
|
|
|
|
|
+
|
|
|
// 使用 Element Plus 表单验证
|
|
// 使用 Element Plus 表单验证
|
|
|
if (!receiptFormRef.value) return
|
|
if (!receiptFormRef.value) return
|
|
|
|
|
|
|
@@ -909,6 +957,32 @@ const openReturnReceiptDialog = async (contractId: string, contractNumber: strin
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const handleDelete = async (row: AContractInfo) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ await ElMessageBox.confirm('确定要删除这条记录吗?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ })
|
|
|
|
|
+ const success = await deleteBatchRentingHouse([row.id])
|
|
|
|
|
+ if (success) {
|
|
|
|
|
+ getList()
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ // 用户取消删除
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const deleteBatchRentingHouse = async (ids: string[]) => {
|
|
|
|
|
+ const res = await clientPost<string[], BaseResponse>('/acontractInfo/deleteBatch', ids)
|
|
|
|
|
+ if (res.code !== 200) {
|
|
|
|
|
+ ElMessage.error(res.msg)
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ ElMessage.success(res.msg)
|
|
|
|
|
+ return true
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 计算退据总金额
|
|
// 计算退据总金额
|
|
|
const calculateReturnTotalAmount = () => {
|
|
const calculateReturnTotalAmount = () => {
|
|
|
returnReceiptForm.rmb = returnReceiptForm.yj + returnReceiptForm.zj + returnReceiptForm.wyf
|
|
returnReceiptForm.rmb = returnReceiptForm.yj + returnReceiptForm.zj + returnReceiptForm.wyf
|
|
@@ -1061,6 +1135,10 @@ onMounted(() => {
|
|
|
class="rounded-lg overflow-hidden"
|
|
class="rounded-lg overflow-hidden"
|
|
|
>
|
|
>
|
|
|
<ElTableColumn prop="contractNumber" label="合同编号" width="160" />
|
|
<ElTableColumn prop="contractNumber" label="合同编号" width="160" />
|
|
|
|
|
+ <ElTableColumn prop="building" label="楼栋"/>
|
|
|
|
|
+ <ElTableColumn prop="floor" label="楼层"/>
|
|
|
|
|
+ <ElTableColumn prop="houseName" label="房间名称"/>
|
|
|
|
|
+ <ElTableColumn prop="assetType" label="房屋类型"/>
|
|
|
<ElTableColumn prop="contractDate" label="签约日期" width="140" />
|
|
<ElTableColumn prop="contractDate" label="签约日期" width="140" />
|
|
|
<ElTableColumn prop="contractTime" label="合同期限" width="120" />
|
|
<ElTableColumn prop="contractTime" label="合同期限" width="120" />
|
|
|
<ElTableColumn prop="contractExpirationDate" label="到期日期" width="140" />
|
|
<ElTableColumn prop="contractExpirationDate" label="到期日期" width="140" />
|
|
@@ -1179,6 +1257,9 @@ onMounted(() => {
|
|
|
>
|
|
>
|
|
|
获取退据
|
|
获取退据
|
|
|
</ElButton>
|
|
</ElButton>
|
|
|
|
|
+ <el-button type="danger" size="small" @click="handleDelete(row)" :icon="Delete">
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|