综合服务维修工单新增处理结果

This commit is contained in:
zjf committed 2025-11-10 13:41:39 +08:00
1 parent 74068cbc86
commit 1813a4ae08
2 files changed
+151 -47

No files matched your search

+106 -2
View File
@@ -47,6 +47,28 @@
<view class="detail-footer">
<text class="create-time">申请时间:{{ formatTime(detail.createTime) }}</text>
</view>
<!-- 回复内容 -->
<view v-if="hasHandleInfo" class="reply-section">
<view class="reply-title">回复内容</view>
<view v-if="detail.handleRemark" class="reply-content">
<text class="reply-text">{{ detail.handleRemark }}</text>
</view>
<view v-if="handleImageList.length" class="handle-image-list">
<image
v-for="(img, idx) in handleImageList"
:key="idx"
:src="filePath(img)"
class="handle-img"
mode="aspectFill"
@click="previewHandleImage(idx)"
/>
</view>
<view class="reply-footer">
<text class="handle-by" v-if="detail.handleBy">处理人:{{ detail.handleBy }}</text>
<text class="handle-time" v-if="detail.handleTime">{{ formatTime(detail.handleTime) }}</text>
</view>
</view>
</view>
</template>
@@ -122,7 +144,7 @@ function getUrgencyLabel(urgency: string) {
function getStatusText(status: string) {
const statusMap: Record<string, string> = {
'1': '待处理',
'1': '已处理',
'2': '处理中',
'3': '已完成',
'4': '已取消'
@@ -132,7 +154,7 @@ function getStatusText(status: string) {
function getStatusClass(status: string) {
const classMap: Record<string, string> = {
'1': 'status-pending',
'1': 'status-completed',
'2': 'status-processing',
'3': 'status-completed',
'4': 'status-cancelled'
@@ -151,6 +173,29 @@ const imageList = computed(() => {
return detail.value.picUrl.split(',').filter(Boolean)
})
// 计算处理图片数组
const handleImageList = computed(() => {
if (!detail.value.handlePicUrl) return []
const picUrl = String(detail.value.handlePicUrl).trim()
if (!picUrl) return []
return picUrl.split(',').map(item => item.trim()).filter(Boolean)
})
// 判断是否有回复内容
const hasHandleInfo = computed(() => {
return detail.value.handleRemark || detail.value.handlePicUrl || detail.value.handleTime || detail.value.handleBy
})
// 预览处理图片
function previewHandleImage(index: number) {
if (handleImageList.value.length === 0) return
const urls = handleImageList.value.map(img => filePath(img))
uni.previewImage({
current: index,
urls: urls
})
}
onLoad(async (options: any) => {
const id = options.id
if (!id) {
@@ -309,6 +354,65 @@ onLoad(async (options: any) => {
}
}
.reply-section {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.reply-title {
font-size: 30rpx;
font-weight: bold;
color: #333;
margin-bottom: 16rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.reply-content {
margin-bottom: 16rpx;
.reply-text {
font-size: 28rpx;
color: #333;
line-height: 1.6;
}
}
.handle-image-list {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
margin-bottom: 16rpx;
}
.handle-img {
width: 180rpx;
height: 180rpx;
border-radius: 8rpx;
background: #f7f8fa;
object-fit: cover;
}
.reply-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 16rpx;
border-top: 1rpx solid #f0f0f0;
.handle-by {
font-size: 24rpx;
color: #666;
}
.handle-time {
font-size: 24rpx;
color: #999;
}
}
}
.detail-footer {
background: #fff;
border-radius: 16rpx;
+45 -45
View File
@@ -43,8 +43,8 @@
</view>
<view class="form-item">
<view class="label">故障描述</view>
<textarea
v-model="description"
<textarea
v-model="description"
placeholder="请详细描述设备故障情况..."
class="description-textarea"
maxlength="300"
@@ -70,9 +70,9 @@
暂无维修记录
</view>
<view v-else>
<view
v-for="item in repairList"
:key="item.id"
<view
v-for="item in repairList"
:key="item.id"
class="repair-item"
@click="viewDetail(item)"
>
@@ -110,9 +110,9 @@ const typeOptions = ref<any[]>([])
const typeOptionsLoaded = ref(false)
const urgencyOptions = [
{ value: 1, label: '高' },
{ value: 3, label: '高' },
{ value: 2, label: '中' },
{ value: 3, label: '低' }
{ value: 1, label: '低' }
]
const typeIndex = ref(-1)
@@ -233,13 +233,13 @@ async function submitRepair() {
uni.showToast({ title: '请填写完整信息', icon: 'none' })
return
}
// 验证维修类型是否已选择
if (typeIndex.value === -1 || !typeOptions.value[typeIndex.value]) {
uni.showToast({ title: '请选择维修类型', icon: 'none' })
return
}
// 收集所有上传成功图片的 url
let picUrl: string[] = []
if (uploadFileUrl.value.length > 0) {
@@ -254,7 +254,7 @@ async function submitRepair() {
}
})
}
try {
uni.showLoading({ title: '提交中...' })
const data = {
@@ -409,22 +409,22 @@ onMounted(() => {
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.form-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 24rpx;
}
.form-item {
margin-bottom: 24rpx;
.label {
font-size: 28rpx;
color: #333;
margin-bottom: 12rpx;
}
.picker {
height: 80rpx;
line-height: 80rpx;
@@ -432,12 +432,12 @@ onMounted(() => {
background: #f7f8fa;
border-radius: 8rpx;
font-size: 28rpx;
&.placeholder {
color: #999;
}
}
.location-input,
.equipment-input,
.phone-input {
@@ -447,7 +447,7 @@ onMounted(() => {
border-radius: 8rpx;
font-size: 28rpx;
}
.description-textarea {
width: 100%;
height: 160rpx;
@@ -457,7 +457,7 @@ onMounted(() => {
font-size: 28rpx;
box-sizing: border-box;
}
.char-count {
text-align: right;
font-size: 24rpx;
@@ -465,7 +465,7 @@ onMounted(() => {
margin-top: 8rpx;
}
}
.submit-btn {
width: 100%;
height: 88rpx;
@@ -473,7 +473,7 @@ onMounted(() => {
color: #fff;
border-radius: 8rpx;
font-size: 32rpx;
&:disabled {
background: #ccc;
}
@@ -484,113 +484,113 @@ onMounted(() => {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
.list-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 24rpx;
}
.empty-tip {
text-align: center;
color: #999;
font-size: 28rpx;
padding: 60rpx 0;
}
.repair-item {
border-bottom: 1rpx solid #f0f0f0;
padding: 24rpx 0;
&:last-child {
border-bottom: none;
}
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
.type-tag {
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
&.type-electrical {
background: #fff3e0;
color: #f57c00;
}
&.type-network {
background: #e3f2fd;
color: #1976d2;
}
&.type-office {
background: #f3e5f5;
color: #7b1fa2;
}
&.type-ac {
background: #e8f5e8;
color: #388e3c;
}
&.type-other {
background: #f5f5f5;
color: #666;
}
}
.status-tag {
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
&.status-pending {
background: #fff3e0;
color: #f57c00;
}
&.status-processing {
background: #e8f5e8;
color: #388e3c;
}
&.status-completed {
background: #e3f2fd;
color: #1976d2;
}
&.status-cancelled {
background: #f5f5f5;
color: #999;
}
}
}
.item-content {
margin-bottom: 16rpx;
.equipment-info {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8rpx;
.equipment-name {
font-size: 28rpx;
font-weight: bold;
color: #333;
}
.location {
font-size: 24rpx;
color: #666;
}
}
.description {
font-size: 26rpx;
color: #666;
@@ -601,17 +601,17 @@ onMounted(() => {
overflow: hidden;
}
}
.item-footer {
display: flex;
justify-content: space-between;
align-items: center;
.time {
font-size: 24rpx;
color: #999;
}
.urgency-tag {
font-size: 24rpx;
color: #d32f2f;
@@ -622,4 +622,4 @@ onMounted(() => {
}
}
}
</style>
</style>