同步6/16
This commit is contained in:
@@ -27,7 +27,13 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="报修标题" prop="item">
|
||||
<el-input v-model.trim="form.item" placeholder="请输入报修标题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="问题描述" prop="problem">
|
||||
@@ -38,7 +44,19 @@
|
||||
<el-row>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="报修人" prop="residentId">
|
||||
<Holder :userid="form.residentId" @change="handleChangeResident"></Holder>
|
||||
<Holder :isMultiple="false" :userid="form.residentId ?? ''" ref="HolderRef" @change="handleChange">
|
||||
<template #default>
|
||||
<div class="residentBox" @click="choiceResidentFun">
|
||||
<div class="defaultbox" v-if="form.residentId === '' || form.residentId === null">
|
||||
<span>请选择</span>
|
||||
<el-icon><Search /></el-icon>
|
||||
</div>
|
||||
<div v-else class="overflow-auto overflow-hidden w-full text-ellipsis text-nowrap">
|
||||
<span>姓名:{{ form?.residentName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</Holder>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -88,9 +106,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { addMonthCard, getMonthCard, updateMonthCard } from '@/api/system/MonthCard';
|
||||
import { getVillageTree } from '@/api/system/house';
|
||||
import { getCommunitylistAPI } from '@/api/system/community';
|
||||
import { convertBuildingToTree, hasFormData } from '@/utils/house';
|
||||
import Holder from '@/components/Holder/index.vue';
|
||||
import { UploadProps, UploadUserFile } from 'element-plus';
|
||||
@@ -114,8 +129,10 @@ const form = ref({
|
||||
id: null,
|
||||
houseId: null, // 关联房屋id
|
||||
maintenanceItemId: null, // 维修项目id
|
||||
item: '', // 标题项目名称
|
||||
problem: '', // 问题描述
|
||||
residentId: null, // 报修人id(住户表id)
|
||||
residentId: '', // 报修人id(住户表id)
|
||||
residentName: '', // 报修人姓名
|
||||
phone: null, // 报手机号码
|
||||
problemImageUrl: '', // 问题图片地址
|
||||
problemStatus: '0', // 0 已提交 1已分配 2维修中 3维修完成
|
||||
@@ -143,7 +160,7 @@ const currentviliage = ref();
|
||||
const maintenanceItemTreeData = ref();
|
||||
function init() {
|
||||
gettreelistRepairProject().then((res) => {
|
||||
maintenanceItemTreeData.value = res.data;
|
||||
maintenanceItemTreeData.value = handleTreeDisable(res.data);
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
form.value.id = userid.value;
|
||||
@@ -168,6 +185,21 @@ function init() {
|
||||
}
|
||||
init();
|
||||
|
||||
function handleTreeDisable(TreeData) {
|
||||
const arr = TreeData.map((item) => {
|
||||
if (item.status === '1') {
|
||||
item.disabled = true;
|
||||
} else {
|
||||
item.disabled = false;
|
||||
}
|
||||
if (item && item.children && item.children.length > 0) {
|
||||
item.children = handleTreeDisable(item.children);
|
||||
}
|
||||
return item;
|
||||
});
|
||||
return arr;
|
||||
}
|
||||
|
||||
// ! 上传图片 =--==================================================================
|
||||
const fileList = ref<UploadUserFile[]>([]);
|
||||
|
||||
@@ -184,8 +216,21 @@ const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
|
||||
};
|
||||
|
||||
// !== 选择报修人 ====================================================================
|
||||
function handleChangeResident(val: string | number) {
|
||||
form.value.residentId = val;
|
||||
const holderInfo = ref(null);
|
||||
const HolderRef = ref<typeof Holder>(null);
|
||||
function choiceResidentFun() {
|
||||
HolderRef.value.open([form.value.residentId]);
|
||||
}
|
||||
// 选择住户
|
||||
function handleChange(pop) {
|
||||
holderInfo.value = null;
|
||||
holderInfo.value = pop;
|
||||
form.value.residentId = '';
|
||||
form.value.residentName = '';
|
||||
if (pop !== null) {
|
||||
form.value.residentId = holderInfo.value.id;
|
||||
form.value.residentName = holderInfo.value.name;
|
||||
}
|
||||
}
|
||||
|
||||
// !== 房屋 ===========================================================================
|
||||
@@ -314,4 +359,21 @@ const cancelForm = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
.residentBox {
|
||||
width: 385px;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
padding: 0 10px;
|
||||
.defaultbox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
background-color: #f4f8ff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="AddBuildingBox">
|
||||
<PageHeader :title="userid ? '编辑车辆信息' : '添加车辆信息'"></PageHeader>
|
||||
<PageHeader></PageHeader>
|
||||
<div class="AddBuildingBody">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="addBuildingFormBody">
|
||||
@@ -41,7 +41,7 @@
|
||||
<el-col :span="11">
|
||||
<el-form-item label="隶属父级" prop="email">
|
||||
<el-select @change="handleChange" v-model="form.parentId" placeholder="请选择隶属父级" style="width: 240px">
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.projectName" :value="item.id" />
|
||||
<el-option v-for="item in options" :key="item.id" :disabled="item.disabled" :label="item.projectName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -59,7 +59,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { addRepairProject, listRepairProject, updateRepairProject } from '@/api/system/RepairProject';
|
||||
import { addRepairProject, getRepairProject, listRepairProject, updateRepairProject } from '@/api/system/RepairProject';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_repair_project_types } = toRefs<any>(proxy?.useDict('com_repair_project_types'));
|
||||
const { com_repair_project_status } = toRefs<any>(proxy?.useDict('com_repair_project_status'));
|
||||
@@ -88,6 +88,7 @@ const userid = ref(null);
|
||||
const options = ref([]);
|
||||
|
||||
function handleChange(val) {
|
||||
if (!val) return;
|
||||
const find = options.value.find((item) => item.id === val);
|
||||
if (find) {
|
||||
form.value.projectType = find.projectType;
|
||||
@@ -95,7 +96,7 @@ function handleChange(val) {
|
||||
}
|
||||
// != ==========================================
|
||||
|
||||
function init() {
|
||||
async function init() {
|
||||
form.value = {
|
||||
id: null,
|
||||
projectName: null, // 项目名称
|
||||
@@ -104,22 +105,26 @@ function init() {
|
||||
projectLevel: 0, //项目层级
|
||||
status: '0' //状态
|
||||
};
|
||||
listRepairProject().then((res) => {
|
||||
const arr = res.rows.filter((ite) => ite.projectLevel === 0);
|
||||
options.value = arr;
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
const find = res.rows.find((item) => item.id === userid.value);
|
||||
if (find) {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...find,
|
||||
projectLevel: find.projectLevel
|
||||
};
|
||||
handleChange(find.parentId);
|
||||
}
|
||||
}
|
||||
});
|
||||
const res = await listRepairProject();
|
||||
const arr = res.rows.filter((ite) => ite.projectLevel === 0);
|
||||
options.value = arr;
|
||||
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
getRepairProject(userid.value).then((res) => {
|
||||
form.value = res.data;
|
||||
form.value.status = res.data.status ?? '0' + '';
|
||||
options.value = options.value.map((ite) => {
|
||||
if (ite.id === res.data.id) {
|
||||
ite.disabled = true;
|
||||
} else {
|
||||
ite.disabled = false;
|
||||
}
|
||||
return ite;
|
||||
});
|
||||
handleChange(res.data.parentId);
|
||||
});
|
||||
}
|
||||
}
|
||||
init();
|
||||
// !== 提交 =============================================================================
|
||||
|
||||
@@ -60,16 +60,17 @@
|
||||
|
||||
<el-table v-loading="loading" border :data="repairList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="报修房屋" align="center" prop="houseName" />
|
||||
<el-table-column label="报修房屋" align="center" show-overflow-tooltip prop="houseName" />
|
||||
<el-table-column label="维修项目" align="center" prop="maintenanceItemName" />
|
||||
<el-table-column label="标题" align="center" prop="item" />
|
||||
<el-table-column label="问题描述" align="center" prop="problem" />
|
||||
<el-table-column label="报修人" align="center" prop="residentName" />
|
||||
<el-table-column label="预约日期" align="center" prop="orderDate" width="180">
|
||||
<el-table-column label="报修人" width="100" align="center" prop="residentName" />
|
||||
<el-table-column label="预约日期" align="center" prop="orderDate" width="150">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.orderDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="维修状态" align="center" prop="problemStatus">
|
||||
<el-table-column label="维修状态" align="center" width="100" prop="problemStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_repair_status" :value="scope.row.problemStatus || ''"></dict-tag>
|
||||
</template>
|
||||
@@ -94,8 +95,6 @@
|
||||
<script setup name="Repair" lang="ts">
|
||||
import { listRepair, delRepair } from '@/api/system/Repair/index';
|
||||
import { RepairVO, RepairQuery, RepairForm } from '@/api/system/Repair/type';
|
||||
import { listRepairProject } from '@/api/system/RepairProject';
|
||||
import { listResident } from '@/api/system/resident';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@@ -103,7 +102,7 @@ const { com_repair_status } = toRefs<any>(proxy?.useDict('com_repair_status'));
|
||||
|
||||
interface repairlistType extends RepairVO {
|
||||
maintenanceItemPath?: string;
|
||||
residentName?: string;
|
||||
residentName: string;
|
||||
}
|
||||
const repairList = ref<repairlistType[]>([]);
|
||||
const loading = ref(true);
|
||||
@@ -164,10 +163,14 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询报修管理列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listRepair(queryParams.value);
|
||||
repairList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
listRepair(queryParams.value)
|
||||
.then((res) => {
|
||||
repairList.value = res.rows;
|
||||
total.value = res.total;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
@@ -178,6 +181,8 @@ const handleQuery = () => {
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryParams.value.problemStatus = '';
|
||||
queryParams.value.orderDate = '';
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
@@ -198,7 +203,7 @@ const handleAdd = () => {
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: RepairVO) => {
|
||||
const _id = row.id || ids.value[0];
|
||||
const _id = row?.id || ids.value[0];
|
||||
router.push({
|
||||
path: '/repair/editRepair',
|
||||
query: {
|
||||
@@ -208,7 +213,7 @@ const handleUpdate = async (row?: RepairVO) => {
|
||||
};
|
||||
/** 分配人员 */
|
||||
const handleShare = (row) => {
|
||||
const _id = row.id || ids.value[0];
|
||||
const _id = row?.id || ids.value[0];
|
||||
router.push({
|
||||
path: '/repair/repairMain',
|
||||
query: {
|
||||
|
||||
@@ -15,28 +15,30 @@
|
||||
</template>
|
||||
<div class="w-full h-full CarinfoBox">
|
||||
<el-row class="mb-20px">
|
||||
<el-col :span="8">
|
||||
<el-col :span="10">
|
||||
<div class="carinfo_item">
|
||||
<div class="label">报修房屋</div>
|
||||
<div class="main">{{ form.house }}</div>
|
||||
<div class="main">{{ form.houseName }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="4"></el-col>
|
||||
<el-col :span="10">
|
||||
<div class="carinfo_item">
|
||||
<div class="label">维修项目</div>
|
||||
<div class="main">{{ form.maintenanceItem }}</div>
|
||||
<div class="main">{{ form.maintenanceItemName }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row class="mb-20px">
|
||||
<el-col :span="8">
|
||||
<el-col :span="10">
|
||||
<div class="carinfo_item">
|
||||
<div class="label">报修人</div>
|
||||
<div class="main">{{ form.residentName }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="4"></el-col>
|
||||
<el-col :span="10">
|
||||
<div class="carinfo_item">
|
||||
<div class="label">手机号码</div>
|
||||
<div class="main">{{ form.phone }}</div>
|
||||
@@ -59,7 +61,7 @@
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-row v-if="form.problemImageUrl.trim() === ''">
|
||||
<el-col :span="24">
|
||||
<div class="carinfo_item">
|
||||
<div class="label">附件</div>
|
||||
@@ -69,10 +71,10 @@
|
||||
:zoom-rate="1.2"
|
||||
:max-scale="7"
|
||||
:min-scale="0.2"
|
||||
:preview-src-list="form.problemImageUrlList"
|
||||
:preview-src-list="form.problemImageUrl.split(',').filter((item) => item)"
|
||||
show-progress
|
||||
:initial-index="0"
|
||||
v-for="(item, index) in form.problemImageUrlList"
|
||||
v-for="(item, index) in form.problemImageUrl.split(',').filter((item) => item)"
|
||||
:key="index"
|
||||
:src="splitImages(item)"
|
||||
class="carinfoImage"
|
||||
@@ -93,9 +95,9 @@
|
||||
<div class="preivewBody w-full h-full flex flex-items-start mt-2">
|
||||
<div class="title">维修师傅</div>
|
||||
<div class="preivewBodybox flex-1 ml-5">
|
||||
<repairUser :userid="form.repairId" @change="handleChange"></repairUser>
|
||||
<repairUser :is-multiple="false" :username="form.repairName" :userid="form.repairUserId" @change="handleChange"> </repairUser>
|
||||
<div class="actions mt-5">
|
||||
<el-button @click="handleSend" type="primary">确定派单</el-button>
|
||||
<el-button v-if="form.problemStatus === '0'" @click="handleSend" type="primary">确定派单</el-button>
|
||||
<el-button @click="backRouter">返回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -150,17 +152,10 @@ import { ref } from 'vue';
|
||||
import repairUser from '@/components/Holder/repairUser.vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { getRepair, updateRepair } from '@/api/system/Repair';
|
||||
import { 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';
|
||||
import { getRepairProcess, listRepairProcess, updateRepairProcess } from '@/api/system/repairProcess';
|
||||
import { splitImages } from '@/utils';
|
||||
|
||||
const houseStore = useHouseStore();
|
||||
const { treedata } = storeToRefs(houseStore);
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
@@ -168,32 +163,41 @@ const active = ref(0);
|
||||
const activeStop = ref(0);
|
||||
|
||||
interface formType extends RepairVO {
|
||||
maintenanceItem?: string;
|
||||
residentName?: string;
|
||||
problemImageUrlList?: string[];
|
||||
house?: string;
|
||||
problemImageUrlList: string[];
|
||||
}
|
||||
|
||||
const form = ref<formType>({
|
||||
'id': null,
|
||||
'houseId': null,
|
||||
'id': '',
|
||||
'houseId': '',
|
||||
'maintenanceItemId': null,
|
||||
'maintenanceItemName': null,
|
||||
'problem': '',
|
||||
'residentId': null,
|
||||
'phone': null,
|
||||
'residentId': '',
|
||||
'residentName': null,
|
||||
'phone': '',
|
||||
'orderDate': '',
|
||||
'problemImageUrl': '',
|
||||
'problemStatus': '0',
|
||||
'problemStatus': '',
|
||||
'repairDes': '',
|
||||
'repairImageUrl': '',
|
||||
'repairId': null
|
||||
'repairId': '',
|
||||
'repairName': '',
|
||||
'houseName': '',
|
||||
'repairUserId': '',
|
||||
'item': null,
|
||||
'projectType': null,
|
||||
'updateTime': '',
|
||||
'projectTypeStr': '',
|
||||
'repairIsCheck': '1',
|
||||
'manageIsCheck': '1',
|
||||
'isCheckStr': null,
|
||||
'repairPhone': null,
|
||||
'repairRoleName': null,
|
||||
'repairStatus': null,
|
||||
'createTime': null,
|
||||
problemImageUrlList: []
|
||||
});
|
||||
const userid = ref();
|
||||
|
||||
// 维修项目
|
||||
const projectlist = ref([]);
|
||||
// 住户
|
||||
const residentList = ref([]);
|
||||
// 审核流程
|
||||
const reviewInfo = ref({
|
||||
'id': '',
|
||||
@@ -207,39 +211,28 @@ const reviewInfo = ref({
|
||||
});
|
||||
// ! 房屋 ====================================================================================================
|
||||
async function init() {
|
||||
// 项目
|
||||
const projectres = await listRepairProject();
|
||||
projectlist.value = projectres.rows;
|
||||
// 住户
|
||||
const residentlistres = await listResident();
|
||||
residentList.value = residentlistres.rows;
|
||||
// 报修详情
|
||||
const res = await getRepair(userid.value);
|
||||
form.value = res.data;
|
||||
const find = projectlist.value.find((item) => item.id === form.value.maintenanceItemId);
|
||||
if (find) {
|
||||
if (find.parentId) {
|
||||
const find2 = projectlist.value.find((item) => item.id === find.parentId);
|
||||
form.value.maintenanceItem = find2.projectName + ' - ' + find.projectName;
|
||||
} else {
|
||||
form.value.maintenanceItem = find.projectName;
|
||||
getRepair(userid.value).then((res) => {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...res.data
|
||||
};
|
||||
try {
|
||||
form.value.problemImageUrlList = form.value.problemImageUrl.split(',').filter((item) => item);
|
||||
} catch {
|
||||
form.value.problemImageUrlList = [];
|
||||
}
|
||||
}
|
||||
|
||||
const houseinfo = getHousePathById(treedata.value, form.value.houseId, 'label');
|
||||
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();
|
||||
}
|
||||
// 获取保修审核状态
|
||||
listRepairProcess({
|
||||
repairId: res.data.id,
|
||||
pageSize: 9999,
|
||||
pageNum: 1
|
||||
}).then((info) => {
|
||||
reviewInfo.value = info.rows[info.rows.length - 1] || null;
|
||||
console.log(reviewInfo.value);
|
||||
handleReview();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 处理审核
|
||||
@@ -269,10 +262,12 @@ if (route.query.id) {
|
||||
|
||||
/** 派单 */
|
||||
function handleSend() {
|
||||
// 已分配
|
||||
form.value.problemStatus = '1';
|
||||
updateRepair(form.value).then(() => {
|
||||
form.value.problemStatus = '1';
|
||||
reviewInfo.value.allocateTime = new Date().toLocaleString().replaceAll('/', '-');
|
||||
if (form.value.repairId) {
|
||||
if (form.value.repairUserId) {
|
||||
reviewInfo.value.allocateStatus = '1';
|
||||
} else {
|
||||
reviewInfo.value.allocateStatus = '0';
|
||||
@@ -285,7 +280,7 @@ function handleSend() {
|
||||
|
||||
/** 选择维修人员 */
|
||||
function handleChange(row) {
|
||||
form.value.repairId = row;
|
||||
form.value.repairUserId = row;
|
||||
}
|
||||
|
||||
/** 返回 */
|
||||
@@ -327,8 +322,9 @@ function handleEdit() {
|
||||
.label {
|
||||
font-weight: 600;
|
||||
width: 80px;
|
||||
text-align: right;
|
||||
text-align: left;
|
||||
padding-right: 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.carinfoImage {
|
||||
margin: 10px;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
:disable-delete="multiple"
|
||||
:disable-edit="single"
|
||||
:show-add="checkPermi(['repairProject:repairProject:add'])"
|
||||
:show-edit="checkPermi(['repairProject:repairProject:edit'])"
|
||||
:show-edit="false"
|
||||
:show-delete="checkPermi(['repairProject:repairProject:remove'])"
|
||||
@update:add="handleAdd"
|
||||
@update:edit="handleUpdate()"
|
||||
|
||||
Reference in New Issue
Block a user