|
|
|
@ -59,7 +59,7 @@
|
|
|
|
</picker>
|
|
|
|
</picker>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<view class="form-item">
|
|
|
|
<!-- <view class="form-item">
|
|
|
|
<text class="label">联系方式</text>
|
|
|
|
<text class="label">联系方式</text>
|
|
|
|
<input
|
|
|
|
<input
|
|
|
|
class="input"
|
|
|
|
class="input"
|
|
|
|
@ -68,18 +68,18 @@
|
|
|
|
placeholder="请输入手机号"
|
|
|
|
placeholder="请输入手机号"
|
|
|
|
maxlength="20"
|
|
|
|
maxlength="20"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</view>
|
|
|
|
</view> -->
|
|
|
|
|
|
|
|
|
|
|
|
<view class="form-item">
|
|
|
|
<view class="form-item">
|
|
|
|
<text class="label">报修内容</text>
|
|
|
|
<text class="label">报修内容</text>
|
|
|
|
<textarea
|
|
|
|
<textarea
|
|
|
|
class="textarea"
|
|
|
|
class="textarea"
|
|
|
|
v-model="form.handleContent"
|
|
|
|
v-model="form.faultDesc"
|
|
|
|
placeholder="请描述故障位置、现象等,便于快速处理"
|
|
|
|
placeholder="请描述故障位置、现象等,便于快速处理"
|
|
|
|
maxlength="300"
|
|
|
|
maxlength="300"
|
|
|
|
:auto-height="true"
|
|
|
|
:auto-height="true"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<text class="count">{{ form.handleContent.length }}/300</text>
|
|
|
|
<text class="count">{{ form.faultDesc.length }}/300</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<view class="form-item">
|
|
|
|
<view class="form-item">
|
|
|
|
@ -130,13 +130,13 @@
|
|
|
|
</text>
|
|
|
|
</text>
|
|
|
|
<text
|
|
|
|
<text
|
|
|
|
class="status"
|
|
|
|
class="status"
|
|
|
|
:class="statusClass(item.status)"
|
|
|
|
:class="statusClassMap[item.status] || statusClassMap['__default__']"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{{ statusText(item.status) }}
|
|
|
|
{{ statusText(item.status) }}
|
|
|
|
</text>
|
|
|
|
</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<text class="time">
|
|
|
|
<text class="time">
|
|
|
|
{{ item.assignTime || item.createTime || '' }}
|
|
|
|
{{ item.reportTime || item.createTime || '' }}
|
|
|
|
</text>
|
|
|
|
</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
@ -147,41 +147,28 @@
|
|
|
|
{{ getFaultTypeLabel(item.faultType) }}
|
|
|
|
{{ getFaultTypeLabel(item.faultType) }}
|
|
|
|
</text>
|
|
|
|
</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="row" v-if="item.assigneContext">
|
|
|
|
<view class="row" v-if="item.faultDesc">
|
|
|
|
<text class="label">报修内容</text>
|
|
|
|
<text class="label">报修内容</text>
|
|
|
|
<text class="value">
|
|
|
|
<text class="value">
|
|
|
|
{{ item.assigneContext }}
|
|
|
|
{{ item.faultDesc }}
|
|
|
|
</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="row" v-if="item.executorName">
|
|
|
|
|
|
|
|
<text class="label">执行人</text>
|
|
|
|
|
|
|
|
<text class="value">
|
|
|
|
|
|
|
|
{{ item.executorName }}
|
|
|
|
|
|
|
|
</text>
|
|
|
|
</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="row" v-if="item.expectedCompleteTime">
|
|
|
|
|
|
|
|
<text class="label">预计完成</text>
|
|
|
|
<view
|
|
|
|
<text class="value">
|
|
|
|
class="image-grid"
|
|
|
|
{{ item.expectedCompleteTime }}
|
|
|
|
v-if="item.files && item.files.length"
|
|
|
|
</text>
|
|
|
|
>
|
|
|
|
</view>
|
|
|
|
<view
|
|
|
|
<view class="row" v-if="item.completeTime">
|
|
|
|
class="image-item"
|
|
|
|
<text class="label">实际完成</text>
|
|
|
|
v-for="(file, imgIndex) in item.files"
|
|
|
|
<text class="value">
|
|
|
|
:key="imgIndex"
|
|
|
|
{{ item.completeTime }}
|
|
|
|
@click="previewRecordImages(item.files, imgIndex)"
|
|
|
|
</text>
|
|
|
|
>
|
|
|
|
</view>
|
|
|
|
<image
|
|
|
|
<view class="row" v-if="item.handleContent">
|
|
|
|
:src="HTTP_ADMIN_URL + '/' + (file.url || file.attDir)"
|
|
|
|
<text class="label">处理情况</text>
|
|
|
|
mode="aspectFill"
|
|
|
|
<text class="value">
|
|
|
|
></image>
|
|
|
|
{{ item.handleContent }}
|
|
|
|
</view>
|
|
|
|
</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="row" v-if="item.costAmount">
|
|
|
|
|
|
|
|
<text class="label">维修费用</text>
|
|
|
|
|
|
|
|
<text class="value">
|
|
|
|
|
|
|
|
¥{{ item.costAmount }}
|
|
|
|
|
|
|
|
</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
@ -221,9 +208,9 @@
|
|
|
|
<text class="name">
|
|
|
|
<text class="name">
|
|
|
|
{{ (item.unitNo ? item.unitNo + '单元' : '') + (item.floorNo ? ' ' + item.floorNo + '层' : '') + (item.houseNo ? ' ' + item.houseNo + '室' : '') || item.houseName || '房屋' }}
|
|
|
|
{{ (item.unitNo ? item.unitNo + '单元' : '') + (item.floorNo ? ' ' + item.floorNo + '层' : '') + (item.houseNo ? ' ' + item.houseNo + '室' : '') || item.houseName || '房屋' }}
|
|
|
|
</text>
|
|
|
|
</text>
|
|
|
|
<text class="desc">
|
|
|
|
<!-- <text class="desc">
|
|
|
|
{{ item.buildingId ? '楼栋 ' + item.buildingId : '' }}
|
|
|
|
{{ item.buildingId ? '楼栋 ' + item.buildingId : '' }}
|
|
|
|
</text>
|
|
|
|
</text> -->
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view
|
|
|
|
<view
|
|
|
|
class="empty"
|
|
|
|
class="empty"
|
|
|
|
@ -257,11 +244,10 @@ export default {
|
|
|
|
activeTab: 'form',
|
|
|
|
activeTab: 'form',
|
|
|
|
form: {
|
|
|
|
form: {
|
|
|
|
phone: '',
|
|
|
|
phone: '',
|
|
|
|
handleContent: '',
|
|
|
|
faultDesc: '',
|
|
|
|
expectedTime: '',
|
|
|
|
|
|
|
|
faultType: ''
|
|
|
|
faultType: ''
|
|
|
|
},
|
|
|
|
},
|
|
|
|
faultTypeIndex: 0,
|
|
|
|
faultTypeIndex: -1,
|
|
|
|
images: [],
|
|
|
|
images: [],
|
|
|
|
selectedHouseId: null,
|
|
|
|
selectedHouseId: null,
|
|
|
|
selectedHouseName: '',
|
|
|
|
selectedHouseName: '',
|
|
|
|
@ -272,11 +258,25 @@ export default {
|
|
|
|
finished: false,
|
|
|
|
finished: false,
|
|
|
|
housePopupVisible: false,
|
|
|
|
housePopupVisible: false,
|
|
|
|
houseList: [],
|
|
|
|
houseList: [],
|
|
|
|
houseLoading: false
|
|
|
|
houseLoading: false,
|
|
|
|
|
|
|
|
statusClassMap: {
|
|
|
|
|
|
|
|
'0': 'status-pending',
|
|
|
|
|
|
|
|
0: 'status-pending',
|
|
|
|
|
|
|
|
'1': 'status-doing',
|
|
|
|
|
|
|
|
1: 'status-doing',
|
|
|
|
|
|
|
|
'2': 'status-done',
|
|
|
|
|
|
|
|
2: 'status-done',
|
|
|
|
|
|
|
|
'99': 'status-done',
|
|
|
|
|
|
|
|
99: 'status-done',
|
|
|
|
|
|
|
|
'__default__': 'status-pending'
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
selectedFaultType() {
|
|
|
|
selectedFaultType() {
|
|
|
|
|
|
|
|
if (this.faultTypeIndex == -1) {
|
|
|
|
|
|
|
|
return '';
|
|
|
|
|
|
|
|
}
|
|
|
|
const types = this.dict.get('fault_type');
|
|
|
|
const types = this.dict.get('fault_type');
|
|
|
|
if (types && types.length > this.faultTypeIndex) {
|
|
|
|
if (types && types.length > this.faultTypeIndex) {
|
|
|
|
return types[this.faultTypeIndex].dictLabel;
|
|
|
|
return types[this.faultTypeIndex].dictLabel;
|
|
|
|
@ -333,7 +333,7 @@ export default {
|
|
|
|
const unitPart = item.unitNo ? item.unitNo + '单元' : '';
|
|
|
|
const unitPart = item.unitNo ? item.unitNo + '单元' : '';
|
|
|
|
const floorPart = item.floorNo ? item.floorNo + '层' : '';
|
|
|
|
const floorPart = item.floorNo ? item.floorNo + '层' : '';
|
|
|
|
const housePart = item.houseNo ? item.houseNo + '室' : '';
|
|
|
|
const housePart = item.houseNo ? item.houseNo + '室' : '';
|
|
|
|
this.selectedHouseName = [unitPart, floorPart, housePart].filter(Boolean).join(' ');
|
|
|
|
this.selectedHouseName = [unitPart, floorPart, housePart].filter(Boolean).join('');
|
|
|
|
this.housePopupVisible = false;
|
|
|
|
this.housePopupVisible = false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
chooseImage() {
|
|
|
|
chooseImage() {
|
|
|
|
@ -410,7 +410,7 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!this.form.handleContent.trim()) {
|
|
|
|
if (!this.form.faultDesc.trim()) {
|
|
|
|
uni.showToast({
|
|
|
|
uni.showToast({
|
|
|
|
title: '请填写报修内容',
|
|
|
|
title: '请填写报修内容',
|
|
|
|
icon: 'none'
|
|
|
|
icon: 'none'
|
|
|
|
@ -421,12 +421,7 @@ export default {
|
|
|
|
// 处理图片信息
|
|
|
|
// 处理图片信息
|
|
|
|
const imagefiles = this.images.map(file => {
|
|
|
|
const imagefiles = this.images.map(file => {
|
|
|
|
let attDir = file.url;
|
|
|
|
let attDir = file.url;
|
|
|
|
// 如果路径以/file/public/开头,去掉这个前缀,因为后端存储格式不需要
|
|
|
|
|
|
|
|
if (attDir.startsWith('file/public/')) {
|
|
|
|
|
|
|
|
attDir = attDir.replace('file/public/', '')
|
|
|
|
|
|
|
|
} else if (attDir.startsWith('file/')) {
|
|
|
|
|
|
|
|
attDir = attDir.replace('file/', '')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
attId: file.id + '',
|
|
|
|
attId: file.id + '',
|
|
|
|
name: file.fileName,
|
|
|
|
name: file.fileName,
|
|
|
|
@ -441,10 +436,10 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const payload = {
|
|
|
|
const payload = {
|
|
|
|
phone: this.form.phone.trim(),
|
|
|
|
// phone: this.form.phone.trim(),
|
|
|
|
assigneContext: this.form.handleContent.trim(),
|
|
|
|
faultDesc: this.form.faultDesc.trim(),
|
|
|
|
remark: this.form.expectedTime.trim(),
|
|
|
|
|
|
|
|
status: this.form.status || '0',
|
|
|
|
status: this.form.status || '0',
|
|
|
|
|
|
|
|
houseId: this.selectedHouseId,
|
|
|
|
houseName: this.selectedHouseName,
|
|
|
|
houseName: this.selectedHouseName,
|
|
|
|
files: imagefiles,
|
|
|
|
files: imagefiles,
|
|
|
|
faultType: this.form.faultType
|
|
|
|
faultType: this.form.faultType
|
|
|
|
@ -460,10 +455,9 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
this.form.phone = '';
|
|
|
|
this.form.phone = '';
|
|
|
|
this.form.handleContent = '';
|
|
|
|
this.form.faultDesc = '';
|
|
|
|
this.form.expectedTime = '';
|
|
|
|
|
|
|
|
this.form.faultType = '';
|
|
|
|
this.form.faultType = '';
|
|
|
|
this.faultTypeIndex = 0;
|
|
|
|
this.faultTypeIndex = -1;
|
|
|
|
this.images = [];
|
|
|
|
this.images = [];
|
|
|
|
|
|
|
|
|
|
|
|
this.page = 1;
|
|
|
|
this.page = 1;
|
|
|
|
@ -517,6 +511,17 @@ export default {
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
previewRecordImages(files, index) {
|
|
|
|
|
|
|
|
if (!files || !files.length) return;
|
|
|
|
|
|
|
|
const urls = files.map(file => {
|
|
|
|
|
|
|
|
const path = file.url || file.attDir || file.filePath;
|
|
|
|
|
|
|
|
return this.HTTP_ADMIN_URL + '/' + path;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
uni.previewImage({
|
|
|
|
|
|
|
|
current: index,
|
|
|
|
|
|
|
|
urls
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
statusText(status) {
|
|
|
|
statusText(status) {
|
|
|
|
if (status === 0 || status === '0') return '待处理';
|
|
|
|
if (status === 0 || status === '0') return '待处理';
|
|
|
|
if (status === 1 || status === '1') return '处理中';
|
|
|
|
if (status === 1 || status === '1') return '处理中';
|
|
|
|
@ -524,13 +529,6 @@ export default {
|
|
|
|
if (status === 99 || status === '99') return '已办结';
|
|
|
|
if (status === 99 || status === '99') return '已办结';
|
|
|
|
return status;
|
|
|
|
return status;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
statusClass(status) {
|
|
|
|
|
|
|
|
const text = this.statusText(status);
|
|
|
|
|
|
|
|
if (text === '已处理' || text === '已办结') return 'status-done';
|
|
|
|
|
|
|
|
if (text === '处理中') return 'status-doing';
|
|
|
|
|
|
|
|
if (text === '待处理') return 'status-pending';
|
|
|
|
|
|
|
|
return '';
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
getFaultTypeLabel(value) {
|
|
|
|
getFaultTypeLabel(value) {
|
|
|
|
const types = this.dict.get('fault_type');
|
|
|
|
const types = this.dict.get('fault_type');
|
|
|
|
if (types) {
|
|
|
|
if (types) {
|
|
|
|
@ -799,6 +797,7 @@ export default {
|
|
|
|
font-weight: 600;
|
|
|
|
font-weight: 600;
|
|
|
|
color: #333;
|
|
|
|
color: #333;
|
|
|
|
margin-right: 16rpx;
|
|
|
|
margin-right: 16rpx;
|
|
|
|
|
|
|
|
max-width: 300rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.status {
|
|
|
|
.status {
|
|
|
|
@ -846,6 +845,28 @@ export default {
|
|
|
|
color: #333;
|
|
|
|
color: #333;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.image-grid {
|
|
|
|
|
|
|
|
margin-top: 12rpx;
|
|
|
|
|
|
|
|
margin-left: 0;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
gap: 12rpx;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.image-item {
|
|
|
|
|
|
|
|
width: calc((100% - 24rpx) / 3);
|
|
|
|
|
|
|
|
aspect-ratio: 1 / 1;
|
|
|
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
image {
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|