完成调查问卷

This commit is contained in:
Zy
2026-04-15 17:32:03 +08:00
parent 40f13be704
commit cf9a1f1585
25 changed files with 2325 additions and 254 deletions

View File

@@ -94,11 +94,11 @@
<div class="title">维修师傅</div>
<div class="preivewBodybox flex-1 ml-5">
<div class="">
<repairUser :userid="userid"></repairUser>
<repairUser :userid="form.repairId" @change="handleChange"></repairUser>
</div>
<div class="actions mt-5">
<el-button type="primary">确定派单</el-button>
<el-button>返回</el-button>
<el-button @click="handleSend" type="primary">确定派单</el-button>
<el-button @click="backRouter">返回</el-button>
</div>
</div>
</div>
@@ -120,25 +120,24 @@
<template #title>
<span>已提交维护信息</span>
</template>
<template #description> 提交成功 2024/10/29 10:28:28 </template>
<template #description> {{ reviewInfo.submitTime ?? '' }} </template>
</el-step>
<el-step>
<template #title>
<span>待分配 </span>
<span>{{ reviewInfo.allocateStatus === '0' ? '待分配' : '已分配' }} </span>
</template>
<template #description>等待物业派单中 </template>
<template #description>{{ reviewInfo.allocateTime ?? '等待物业派单中' }} </template>
</el-step>
<el-step>
<template #title>
<span>维修 </span>
<span>{{ reviewInfo.completeStatus === '0' ? '待维修' : '已维修' }} </span>
</template>
<template #description>维修人员进行维修 </template>
<template #description> {{ reviewInfo.completeTime ?? '维修人员进行维修' }}</template>
</el-step>
<el-step>
<template #title>
<span>完成维修 </span>
</template>
<template #description>填写维修记录 </template>
</el-step>
</el-steps>
</div>
@@ -152,22 +151,22 @@
import { ref } from 'vue';
import repairUser from '@/components/Holder/repairUser.vue';
import PageHeader from '@/components/Pageheader/index.vue';
import { getRepair } from '@/api/system/Repair';
import { getCommunitylistAPI } from '@/api/system/community';
import { getVillageTree } from '@/api/system/house';
import { getRepair, updateRepair } from '@/api/system/Repair';
import { convertBuildingToTree, getHousePathById } from '@/utils/house';
import { listRepairProject } from '@/api/system/RepairProject';
import { listResident } from '@/api/system/resident';
import { RepairVO } from '@/api/system/Repair/type';
import { useHouseStore } from '@/store/modules/house';
import { listRepairProcess, updateRepairProcess } from '@/api/system/repairProcess';
const houseStore = useHouseStore();
const { treedata } = storeToRefs(houseStore);
const route = useRoute();
const router = useRouter();
const active = ref(6);
const activeStop = ref(4);
const active = ref(0);
const activeStop = ref(0);
interface formType extends RepairVO {
maintenanceItem?: string;
@@ -196,6 +195,17 @@ const userid = ref();
const projectlist = ref([]);
// 住户
const residentList = ref([]);
// 审核流程
const reviewInfo = ref({
'id': '',
'repairId': '',
'submitTime': '',
'submitStatus': '0',
'allocateTime': null,
'allocateStatus': '0',
'completeTime': null,
'completeStatus': '0'
});
// ! 房屋 ====================================================================================================
async function init() {
// 项目
@@ -217,15 +227,41 @@ async function init() {
}
}
const houseinfo = getHousePathById(treedata.value, Number(form.value.houseId), 'label');
console.log(treedata.value);
const houseinfo = getHousePathById(treedata.value, form.value.houseId, 'label');
console.log(treedata.value, form.value.houseId, houseinfo);
form.value.house = houseinfo.join(' - ');
const residentinfo = residentList.value.find((item) => item.id === form.value.residentId);
form.value.residentName = residentinfo.name;
form.value.problemImageUrlList = form.value.problemImageUrl.split(',').filter((item) => item);
// 获取保修审核状态
const info = await listRepairProcess({ repairId: form.value.id, pageNum: 1, pageSize: 999999 });
if (info && info.rows.length > 0) {
reviewInfo.value = info.rows.pop();
handleReview();
}
}
// 处理审核
function handleReview() {
if (reviewInfo.value.submitStatus === '1') {
// 提交完成
active.value = 1;
activeStop.value = 1;
if (reviewInfo.value.allocateStatus === '1') {
// 分配完成
active.value = 2;
activeStop.value = 2;
// 维修完成
if (reviewInfo.value.completeStatus === '1') {
active.value = 4;
activeStop.value = 4;
}
}
}
}
if (route.query.id) {
@@ -233,6 +269,34 @@ if (route.query.id) {
init();
}
/** 派单 */
function handleSend() {
form.value.problemStatus = '1';
updateRepair(form.value).then(() => {
reviewInfo.value.allocateTime = new Date().toLocaleString().replaceAll('/', '-');
if (form.value.repairId) {
reviewInfo.value.allocateStatus = '1';
} else {
reviewInfo.value.allocateStatus = '0';
}
updateRepairProcess(reviewInfo.value).then(() => {
backRouter();
});
});
}
/** 选择维修人员 */
function handleChange(row) {
form.value.repairId = row;
}
/** 返回 */
function backRouter() {
router.push({
path: '/repair/repairlist'
});
}
function handleEdit() {
router.push({
path: '/repair/addRepair',