Browse Source

首页延租办理完成

wyx
wangyx 3 months ago
parent
commit
b7aaf1f302
  1. 46
      src/views/components/RenewalDialog.vue
  2. 67
      src/views/index.vue

46
src/views/components/RenewalDialog.vue

@ -53,7 +53,7 @@
> >
<el-table-column <el-table-column
prop="checkOutDate" prop="checkOutDate"
label="续期申请时间" label="延租申请时间"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
align="center" align="center"
></el-table-column> ></el-table-column>
@ -108,7 +108,7 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" label="续期至" align="center"> <el-table-column prop="status" label="延租至" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.renewalEndDate }} {{ scope.row.renewalEndDate }}
</template> </template>
@ -128,7 +128,7 @@
scope.row.state === "0" scope.row.state === "0"
? "待办理" ? "待办理"
: scope.row.state === "1" : scope.row.state === "1"
? "已完成续期" ? "已完成延租"
: "" : ""
}} }}
</span> </span>
@ -156,22 +156,16 @@
@pagination="getList" @pagination="getList"
/> />
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
import { listRenewRec, handleRenewal } from "@/api/mz/rec"; import { listRenewRec } from "@/api/mz/rec";
export default { export default {
name: "CommonReminder", name: "CommonReminder",
props: {}, props: {},
data() { data() {
return { return {
openRenew: false, //
renewForm: {
renewalId: "", // ID
remark: "", //
},
renewInfo: {}, renewInfo: {},
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -193,17 +187,7 @@ export default {
try { try {
const response = await listRenewRec(this.queryParams); const response = await listRenewRec(this.queryParams);
if (response.code === 200) { if (response.code === 200) {
const currentDate = new Date(); this.tableData = response.rows;
const processedData = response.rows.map((item) => {
const checkOutDate = new Date(item.checkOutDate);
if (checkOutDate > currentDate) {
item.status = "待办理";
} else {
item.status = "已超期";
}
return item;
});
this.tableData = processedData;
this.total = response.total; this.total = response.total;
} }
} catch (error) {} } catch (error) {}
@ -213,25 +197,9 @@ export default {
}, },
handleAction(row) { handleAction(row) {
console.log("row::", row); console.log("row::", row);
this.$emit("close");
this.openRenew = true; //
this.renewInfo = row; this.renewInfo = row;
this.renewForm.renewalId = row.renewalId; this.$emit("openRenewl");
}, this.$emit("update-renew-form", this.renewInfo);
handleRenewSubmit() {
handleRenewal(this.renewForm)
.then((res) => {
console.log("res", res);
this.$message({
message: "续期办理成功",
type: "success",
});
this.openRenew = false;
this.getList();
})
.catch((err) => {
this.$message.error(err.message || "操作失败");
});
}, },
}, },
}; };

67
src/views/index.vue

@ -234,10 +234,18 @@
top="5vh" top="5vh"
append-to-body append-to-body
> >
<RenewalDialog @close="renewalVisible = !renewalVisible;openRenew=true " /> <RenewalDialog
ref="renewalDialogRef"
@close="renewalVisible = !renewalVisible"
@update-renew-form="updateRenewForm"
@openRenewl="
openRenew = true;
renewForm.remark = null;
"
/>
</el-dialog> </el-dialog>
<!-- 续期办理弹框 --> <!-- 延租办理弹框 -->
<el-dialog title="续期办理" :visible.sync="openRenew" width="55%"> <el-dialog title="延租办理" :visible.sync="openRenew" width="55%">
<el-form :model="renewForm" ref="renewForm" label-width="100px"> <el-form :model="renewForm" ref="renewForm" label-width="100px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8" class="mb-10" <el-col :span="8" class="mb-10"
@ -260,10 +268,10 @@
<div class="line"></div> <div class="line"></div>
</el-col> </el-col>
<el-col :span="8" class="mb-10" <el-col :span="8" class="mb-10"
>申请续期时间{{ renewInfo.renewalApplyTime }}</el-col >申请延租时间{{ renewInfo.renewalApplyTime }}</el-col
> >
<el-col :span="8" class="mb-10" <el-col :span="8" class="mb-10"
>申请续期{{ renewInfo.renewalEndDate }}</el-col >申请延租{{ renewInfo.renewalEndDate }}</el-col
> >
<el-col :span="8" class="mb-10" <el-col :span="8" class="mb-10"
@ -278,10 +286,10 @@
}}</el-col }}</el-col
> >
<el-col :span="8" class="mb-10" <el-col :span="8" class="mb-10"
>续期房间{{ renewInfo.renewalRoom }}</el-col >延租房间{{ renewInfo.renewalRoom }}</el-col
> >
<el-col :span="16" class="mb-10"> <el-col :span="16" class="mb-10">
签订续期合同 签订延租合同
<span <span
:class="{ :class="{
'waiting-sign': renewInfo.employState == '1', 'waiting-sign': renewInfo.employState == '1',
@ -339,7 +347,7 @@ import {
listCheckoutAlert, listCheckoutAlert,
} from "@/api/residence/checkout"; } from "@/api/residence/checkout";
import { checkInReservation } from "@/api/recs"; import { checkInReservation } from "@/api/recs";
import { listRenewRec } from "@/api/mz/rec"; import { listRenewRec, handleRenewal } from "@/api/mz/rec";
import * as Echarts from "echarts"; import * as Echarts from "echarts";
import CommonTitle from "./components/CommonTitle.vue"; import CommonTitle from "./components/CommonTitle.vue";
@ -545,9 +553,9 @@ export default {
releaseTableData: [], releaseTableData: [],
releaseVisible: false, releaseVisible: false,
renewalVisible: false, // renewalVisible: false, //
openRenew: false, // openRenew: false, //
renewForm: { renewForm: {
renewalId: "", // ID renewalId: "", // ID
remark: "", // remark: "", //
}, },
renewInfo: {}, renewInfo: {},
@ -745,7 +753,7 @@ export default {
}, },
// //
async getRenewRecList() { async getRenewRecList() {
const response = await listRenewRec(this.queryParams); const response = await listRenewRec(this.queryParams);
if (response.code === 200) { if (response.code === 200) {
this.workbenchItems = this.workbenchItems.map((item) => { this.workbenchItems = this.workbenchItems.map((item) => {
if (item.id === 5) { if (item.id === 5) {
@ -790,6 +798,30 @@ export default {
}); });
} }
}, },
updateRenewForm(renewInfo) {
this.renewInfo = renewInfo;
this.renewForm.renewalId = renewInfo.renewalId;
},
handleRenewSubmit() {
console.log("this.renewForm", this.renewForm);
handleRenewal(this.renewForm)
.then((res) => {
console.log("res", res);
this.$message({
message: res.msg,
type: "success",
});
this.openRenew = false;
if (this.$refs.renewalDialogRef) {
this.$refs.renewalDialogRef.getList();
}
})
.catch((err) => {
this.$message.error(err.msg || "操作失败");
});
},
}, },
}; };
</script> </script>
@ -998,4 +1030,17 @@ export default {
::v-deep .colItem .el-col-5 { ::v-deep .colItem .el-col-5 {
width: 19.766667%; width: 19.766667%;
} }
.line {
margin: 30px 0;
height: 2px;
border-top: 1px solid transparent;
background: linear-gradient(white, white) padding-box,
repeating-linear-gradient(-45deg, #ccc 0, #ccc 3px, white 0, white 5px);
}
.waiting-sign {
color: #fa9e0a;
}
.signed {
color: #08b3b3;
}
</style> </style>

Loading…
Cancel
Save