同步6/16
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user